Closed tetherit closed 9 years ago
You're passing {{ wait_delay }}
for the delay
argument, which is the "number of seconds to wait before starting to poll". Perhaps wait_delay
is 300?
You can seen the output it isn't:
TASK: [common | wait_for "host=10.8.0.97 port=22 delay=10 connect_timeout=5 timeout=1800"] ***
REMOTE_MODULE wait_for "host=10.8.0.97 port=22 delay=10 connect_timeout=5 timeout=1800"
Updated the description to make that clearer.
Ah, right, sorry. I think I figured out what's going on. Your syntax is not quite right. This:
module: wait_for
"host={{ ipaddress }} port=22 delay=10 connect_timeout=5 timeout=1800"
Passes these parameters to wait_for:
{
'state': 'started',
'connect_timeout': 5,
'delay': 0,
'host': '192.168.55.128 port=22 delay=10 connect_timeout=5 timeout=1800',
'timeout': 300,
'exclude_hosts': None,
'search_regex': None,
'path': None,
'port': None
}
In other words, it thinks all your parameters are part of "host=...", and everything else is a default value. The defaults are, apparently, to wait for 5 minutes for nothing to happen. :) This works for me:
- local_action:
module: wait_for host={{ ipaddress }} port=22 delay=10 connect_timeout=5 timeout=1800
Ah, that did it, thank you! - Maybe the module should show a warning though like issue: https://github.com/ansible/ansible-modules-core/issues/400
I have this task:
I can telnet to a running SSH just fine from this machine:
But when I try this from Ansible, I see this:
I also tried to copy the python script from /Users/Hackeron/.ansible/tmp/ansible-tmp-1428085244.93-113060526613695/wait_for to ~/ and run that - and that too takes 5 minutes to run.
Why is it taking 5 minutes to check that SSH is up?