|
|
|
@ -43,7 +43,7 @@ options:
|
|
|
|
responses. List functionality is new in 2.1.
|
|
|
|
responses. List functionality is new in 2.1.
|
|
|
|
required: true
|
|
|
|
required: true
|
|
|
|
timeout:
|
|
|
|
timeout:
|
|
|
|
type: int
|
|
|
|
type: raw
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- Amount of time in seconds to wait for the expected strings. Use
|
|
|
|
- Amount of time in seconds to wait for the expected strings. Use
|
|
|
|
V(null) to disable timeout.
|
|
|
|
V(null) to disable timeout.
|
|
|
|
@ -122,6 +122,7 @@ except ImportError:
|
|
|
|
|
|
|
|
|
|
|
|
from ansible.module_utils.basic import AnsibleModule, missing_required_lib
|
|
|
|
from ansible.module_utils.basic import AnsibleModule, missing_required_lib
|
|
|
|
from ansible.module_utils.common.text.converters import to_bytes, to_native
|
|
|
|
from ansible.module_utils.common.text.converters import to_bytes, to_native
|
|
|
|
|
|
|
|
from ansible.module_utils.common.validation import check_type_int
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def response_closure(module, question, responses):
|
|
|
|
def response_closure(module, question, responses):
|
|
|
|
@ -147,7 +148,7 @@ def main():
|
|
|
|
creates=dict(type='path'),
|
|
|
|
creates=dict(type='path'),
|
|
|
|
removes=dict(type='path'),
|
|
|
|
removes=dict(type='path'),
|
|
|
|
responses=dict(type='dict', required=True),
|
|
|
|
responses=dict(type='dict', required=True),
|
|
|
|
timeout=dict(type='int', default=30),
|
|
|
|
timeout=dict(type='raw', default=30),
|
|
|
|
echo=dict(type='bool', default=False),
|
|
|
|
echo=dict(type='bool', default=False),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
@ -162,6 +163,13 @@ def main():
|
|
|
|
removes = module.params['removes']
|
|
|
|
removes = module.params['removes']
|
|
|
|
responses = module.params['responses']
|
|
|
|
responses = module.params['responses']
|
|
|
|
timeout = module.params['timeout']
|
|
|
|
timeout = module.params['timeout']
|
|
|
|
|
|
|
|
if timeout is not None:
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
|
|
|
timeout = check_type_int(timeout)
|
|
|
|
|
|
|
|
except TypeError as te:
|
|
|
|
|
|
|
|
module.fail_json(
|
|
|
|
|
|
|
|
msg="argument 'timeout' is of type {timeout_type} and we were unable to convert to int: {te}".format(timeout_type=type(timeout), te=te)
|
|
|
|
|
|
|
|
)
|
|
|
|
echo = module.params['echo']
|
|
|
|
echo = module.params['echo']
|
|
|
|
|
|
|
|
|
|
|
|
events = dict()
|
|
|
|
events = dict()
|
|
|
|
|