reorganize the wait_for functions #159

pull/171/head
Jack Ivanov 8 years ago
parent 17bd6c6a0c
commit 03c805cb87

@ -11,6 +11,20 @@
- { role: cloud-azure, tags: ['azure'] }
- { role: local, tags: ['local'] }
post_tasks:
- name: Wait until SSH becomes ready...
local_action:
module: wait_for
port: 22
host: "{{ cloud_instance_ip }}"
search_regex: "OpenSSH"
delay: 10
timeout: 320
state: present
become: false
tags:
- cloud
- name: Post-provisioning tasks
hosts: vpn-host
gather_facts: false

@ -67,5 +67,5 @@
cloud_provider: azure
ipv6_support: no
- name: Wait for SSH to become available
local_action: "wait_for port=22 host={{ ip_address }} timeout=320"
- set_fact:
cloud_instance_ip: "{{ ip_address }}"

@ -36,5 +36,5 @@
cloud_provider: digitalocean
ipv6_support: yes
- name: Wait for SSH to become available
local_action: "wait_for port=22 host={{ do.droplet.ip_address }} timeout=320"
- set_fact:
cloud_instance_ip: "{{ do.droplet.ip_address }}"

@ -108,7 +108,5 @@
ipv6_support: no
with_items: "{{ ec2.tagged_instances }}"
- name: Wait for SSH to become available
local_action: "wait_for port=22 host={{ item.public_dns_name }} timeout=320"
with_items: "{{ ec2.tagged_instances }}"
become: false
- set_fact:
cloud_instance_ip: "{{ ec2.tagged_instances[0].public_ip }}"

@ -36,5 +36,5 @@
credentials_file: "{{ credentials_file }}"
project_id: "{{ credentials_file_lookup.project_id }}"
- name: Waiting for SSH to become available
local_action: "wait_for port=22 host={{ google_vm.instance_data[0].public_ip }} timeout=320"
- set_fact:
cloud_instance_ip: "{{ google_vm.instance_data[0].public_ip }}"

@ -28,15 +28,14 @@
tags:
- cloud
- name: Wait for shutdown
local_action: wait_for host={{ inventory_hostname }} port=22 state=stopped timeout=120
when: reboot_required is defined and reboot_required.stdout == 'required'
become: false
tags:
- cloud
- name: Wait until SSH becomes ready...
local_action: wait_for host={{ inventory_hostname }} port=22 state=started timeout=120
local_action:
module: wait_for
port: 22
host: "{{ inventory_hostname }}"
search_regex: OpenSSH
delay: 10
timeout: 320
when: reboot_required is defined and reboot_required.stdout == 'required'
become: false
tags:

@ -19,6 +19,5 @@
cloud_provider: local
when: server_ip == "localhost"
- name: Waiting for SSH to become available
local_action: "wait_for port=22 host={{ server_ip }} timeout=320"
when: server_ip != "localhost"
- set_fact:
cloud_instance_ip: "{{ server_ip }}"

@ -41,8 +41,15 @@
ssh_tunneling_enabled: "{{ ssh_tunneling_enabled }}"
IP_subject: "{{ IP_subject }}"
- name: Wait for SSH to become available
local_action: "wait_for port=22 host={{ server_ip }} timeout=320"
- name: Wait until SSH becomes ready...
local_action:
module: wait_for
port: 22
host: "{{ server_ip }}"
search_regex: "OpenSSH"
delay: 10
timeout: 320
state: present
become: false
- name: User management

Loading…
Cancel
Save