mirror of
https://github.com/trailofbits/algo.git
synced 2025-06-07 23:53:58 +02:00
reorganize the wait_for functions #159
This commit is contained in:
parent
17bd6c6a0c
commit
03c805cb87
8 changed files with 40 additions and 23 deletions
14
deploy.yml
14
deploy.yml
|
@ -11,6 +11,20 @@
|
||||||
- { role: cloud-azure, tags: ['azure'] }
|
- { role: cloud-azure, tags: ['azure'] }
|
||||||
- { role: local, tags: ['local'] }
|
- { 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
|
- name: Post-provisioning tasks
|
||||||
hosts: vpn-host
|
hosts: vpn-host
|
||||||
gather_facts: false
|
gather_facts: false
|
||||||
|
|
|
@ -67,5 +67,5 @@
|
||||||
cloud_provider: azure
|
cloud_provider: azure
|
||||||
ipv6_support: no
|
ipv6_support: no
|
||||||
|
|
||||||
- name: Wait for SSH to become available
|
- set_fact:
|
||||||
local_action: "wait_for port=22 host={{ ip_address }} timeout=320"
|
cloud_instance_ip: "{{ ip_address }}"
|
||||||
|
|
|
@ -36,5 +36,5 @@
|
||||||
cloud_provider: digitalocean
|
cloud_provider: digitalocean
|
||||||
ipv6_support: yes
|
ipv6_support: yes
|
||||||
|
|
||||||
- name: Wait for SSH to become available
|
- set_fact:
|
||||||
local_action: "wait_for port=22 host={{ do.droplet.ip_address }} timeout=320"
|
cloud_instance_ip: "{{ do.droplet.ip_address }}"
|
||||||
|
|
|
@ -108,7 +108,5 @@
|
||||||
ipv6_support: no
|
ipv6_support: no
|
||||||
with_items: "{{ ec2.tagged_instances }}"
|
with_items: "{{ ec2.tagged_instances }}"
|
||||||
|
|
||||||
- name: Wait for SSH to become available
|
- set_fact:
|
||||||
local_action: "wait_for port=22 host={{ item.public_dns_name }} timeout=320"
|
cloud_instance_ip: "{{ ec2.tagged_instances[0].public_ip }}"
|
||||||
with_items: "{{ ec2.tagged_instances }}"
|
|
||||||
become: false
|
|
||||||
|
|
|
@ -36,5 +36,5 @@
|
||||||
credentials_file: "{{ credentials_file }}"
|
credentials_file: "{{ credentials_file }}"
|
||||||
project_id: "{{ credentials_file_lookup.project_id }}"
|
project_id: "{{ credentials_file_lookup.project_id }}"
|
||||||
|
|
||||||
- name: Waiting for SSH to become available
|
- set_fact:
|
||||||
local_action: "wait_for port=22 host={{ google_vm.instance_data[0].public_ip }} timeout=320"
|
cloud_instance_ip: "{{ google_vm.instance_data[0].public_ip }}"
|
||||||
|
|
|
@ -28,15 +28,14 @@
|
||||||
tags:
|
tags:
|
||||||
- cloud
|
- 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...
|
- 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'
|
when: reboot_required is defined and reboot_required.stdout == 'required'
|
||||||
become: false
|
become: false
|
||||||
tags:
|
tags:
|
||||||
|
|
|
@ -19,6 +19,5 @@
|
||||||
cloud_provider: local
|
cloud_provider: local
|
||||||
when: server_ip == "localhost"
|
when: server_ip == "localhost"
|
||||||
|
|
||||||
- name: Waiting for SSH to become available
|
- set_fact:
|
||||||
local_action: "wait_for port=22 host={{ server_ip }} timeout=320"
|
cloud_instance_ip: "{{ server_ip }}"
|
||||||
when: server_ip != "localhost"
|
|
||||||
|
|
11
users.yml
11
users.yml
|
@ -41,8 +41,15 @@
|
||||||
ssh_tunneling_enabled: "{{ ssh_tunneling_enabled }}"
|
ssh_tunneling_enabled: "{{ ssh_tunneling_enabled }}"
|
||||||
IP_subject: "{{ IP_subject }}"
|
IP_subject: "{{ IP_subject }}"
|
||||||
|
|
||||||
- name: Wait for SSH to become available
|
- name: Wait until SSH becomes ready...
|
||||||
local_action: "wait_for port=22 host={{ server_ip }} timeout=320"
|
local_action:
|
||||||
|
module: wait_for
|
||||||
|
port: 22
|
||||||
|
host: "{{ server_ip }}"
|
||||||
|
search_regex: "OpenSSH"
|
||||||
|
delay: 10
|
||||||
|
timeout: 320
|
||||||
|
state: present
|
||||||
become: false
|
become: false
|
||||||
|
|
||||||
- name: User management
|
- name: User management
|
||||||
|
|
Loading…
Add table
Reference in a new issue