|
@@ -20,6 +20,7 @@
|
|
- host-type-{{ type }}
|
|
- host-type-{{ type }}
|
|
- sub-host-type-{{ g_sub_host_type }}
|
|
- sub-host-type-{{ g_sub_host_type }}
|
|
- env-host-type-{{ cluster }}-openshift-{{ type }}
|
|
- env-host-type-{{ cluster }}-openshift-{{ type }}
|
|
|
|
+ when: instances |length > 0
|
|
register: gce
|
|
register: gce
|
|
|
|
|
|
- name: Add new instances to groups and set variables needed
|
|
- name: Add new instances to groups and set variables needed
|
|
@@ -31,11 +32,11 @@
|
|
groups: "{{ item.tags | oo_prepend_strings_in_list('tag_') | join(',') }}"
|
|
groups: "{{ item.tags | oo_prepend_strings_in_list('tag_') | join(',') }}"
|
|
gce_public_ip: "{{ item.public_ip }}"
|
|
gce_public_ip: "{{ item.public_ip }}"
|
|
gce_private_ip: "{{ item.private_ip }}"
|
|
gce_private_ip: "{{ item.private_ip }}"
|
|
- with_items: gce.instance_data
|
|
|
|
|
|
+ with_items: gce.instance_data | default([])
|
|
|
|
|
|
- name: Wait for ssh
|
|
- name: Wait for ssh
|
|
wait_for: port=22 host={{ item.name }}
|
|
wait_for: port=22 host={{ item.name }}
|
|
- with_items: gce.instance_data
|
|
|
|
|
|
+ with_items: gce.instance_data | default([])
|
|
|
|
|
|
- name: Wait for user setup
|
|
- name: Wait for user setup
|
|
command: "ssh -o StrictHostKeyChecking=no -o PasswordAuthentication=no -o ConnectTimeout=10 -o UserKnownHostsFile=/dev/null {{ hostvars[item.name].ansible_ssh_user }}@{{ item.public_ip }} echo {{ hostvars[item.name].ansible_ssh_user }} user is setup"
|
|
command: "ssh -o StrictHostKeyChecking=no -o PasswordAuthentication=no -o ConnectTimeout=10 -o UserKnownHostsFile=/dev/null {{ hostvars[item.name].ansible_ssh_user }}@{{ item.public_ip }} echo {{ hostvars[item.name].ansible_ssh_user }} user is setup"
|
|
@@ -43,4 +44,4 @@
|
|
until: result.rc == 0
|
|
until: result.rc == 0
|
|
retries: 30
|
|
retries: 30
|
|
delay: 5
|
|
delay: 5
|
|
- with_items: gce.instance_data
|
|
|
|
|
|
+ with_items: gce.instance_data | default([])
|