From db15528de322a2231b16ceb54eb4a5de23c53e1c Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Thu, 8 Jun 2017 13:40:48 -0400 Subject: [PATCH] added example for those with ansible_connection set --- lib/ansible/modules/utilities/logic/wait_for.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/ansible/modules/utilities/logic/wait_for.py b/lib/ansible/modules/utilities/logic/wait_for.py index 3171ec41c3..4211a57fe5 100644 --- a/lib/ansible/modules/utilities/logic/wait_for.py +++ b/lib/ansible/modules/utilities/logic/wait_for.py @@ -159,6 +159,16 @@ EXAMPLES = r''' search_regex: OpenSSH delay: 10 connection: local + +# Same as above but you normally have ansible_connection set in inventory, which overrides 'connection' +- name: Wait 300 seconds for port 22 to become open and contain "OpenSSH" + wait_for: + port: 22 + host: '{{ (ansible_ssh_host|default(ansible_host))|default(inventory_hostname) }}' + search_regex: OpenSSH + delay: 10 + vars: + ansible_connection: local ''' import binascii