mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-02-28 01:29:42 +03:00
Improve method to create and wait for gce instances (#1645)
This commit is contained in:
@@ -34,6 +34,10 @@
|
||||
tags: "build-{{test_name}},{{kube_network_plugin}}"
|
||||
register: gce
|
||||
|
||||
- name: Add instances to host group
|
||||
add_host: hostname={{item.name}} ansible_host={{item.public_ip}} groupname="waitfor_hosts"
|
||||
with_items: '{{gce.instance_data}}'
|
||||
|
||||
- name: Template the inventory
|
||||
template:
|
||||
src: ../templates/inventory-gce.j2
|
||||
@@ -51,6 +55,10 @@
|
||||
dest: "{{ inventory_path|dirname }}/group_vars/fake_hosts.yml"
|
||||
when: mode in ['scale', 'separate-scale', 'ha-scale']
|
||||
|
||||
- name: Wait for SSH to come up
|
||||
wait_for: host={{item.public_ip}} port=22 delay=30 timeout=180 state=started
|
||||
with_items: "{{gce.instance_data}}"
|
||||
|
||||
- name: Wait for instances
|
||||
hosts: "waitfor_hosts"
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- name: Wait for SSH to come up.
|
||||
local_action: wait_for host={{inventory_hostname}} port=22 delay=5 timeout=240 state=started
|
||||
|
||||
Reference in New Issue
Block a user