Is there a way we can delay the connection instead of unreachable

19 views
Skip to first unread message

Work-Hard

unread,
Apr 6, 2020, 1:09:22 AM4/6/20
to Ansible Project
Hello,

ISSUE -  Whenever a user in a company is not connected to the vpn; ansible fails the connection (as unreachable). Is there a way we can delay the connection for 20 days and have it keep trying every hour, instead of showing "unreachable"?

REASON-  I need the output to look clean when I save the file in order to validate within the company.

I appreciate your help!

Thanks

hammou zligui

unread,
Apr 7, 2020, 12:27:08 PM4/7/20
to Ansible Project
Yes;
use pause module, as an example : playbook that create 10 VMs and inatll http on these 10 VMs, so before installing httpd i should wait for VMs to be up i use pause

exemple using pause module

-name: pause for 2 mins
   pause:
        minutes: 2

good lok

Phil Griffiths

unread,
Apr 7, 2020, 4:07:15 PM4/7/20
to Ansible Project
This just sounds like a really bad idea! Having plays hanging around waiting for 20 days doesn't sound sensible.
Why not just fail controllably after a number of retries perhaps?

I use something like this to do this:
...tasks...
register: output
until: output is not failed
retries: 3
Reply all
Reply to author
Forward
0 new messages