summaryrefslogtreecommitdiffstats
path: root/playbooks/gce/openshift-cluster/tasks
diff options
context:
space:
mode:
authorThomas Wiest <twiest@users.noreply.github.com>2015-10-14 11:11:34 -0400
committerThomas Wiest <twiest@users.noreply.github.com>2015-10-14 11:11:34 -0400
commitb9fb83e6855daca7ac03eb3ca6f826c64f60b264 (patch)
tree8154ec29cd5327e28530b195b71e6ea40fe8a193 /playbooks/gce/openshift-cluster/tasks
parentf1b82648b06f393dfc960a4fc1f5bbe5b97b608a (diff)
parentccf9acd9dad5c9dc2e1640f417a9109c9042a689 (diff)
downloadopenshift-b9fb83e6855daca7ac03eb3ca6f826c64f60b264.tar.gz
openshift-b9fb83e6855daca7ac03eb3ca6f826c64f60b264.tar.bz2
openshift-b9fb83e6855daca7ac03eb3ca6f826c64f60b264.tar.xz
openshift-b9fb83e6855daca7ac03eb3ca6f826c64f60b264.zip
Merge pull request #688 from twiest/gce
Fixed GCE playbooks so that they're more like the AWS playbooks.
Diffstat (limited to 'playbooks/gce/openshift-cluster/tasks')
-rw-r--r--playbooks/gce/openshift-cluster/tasks/launch_instances.yml21
1 files changed, 18 insertions, 3 deletions
diff --git a/playbooks/gce/openshift-cluster/tasks/launch_instances.yml b/playbooks/gce/openshift-cluster/tasks/launch_instances.yml
index e300b5b5a..c428cb465 100644
--- a/playbooks/gce/openshift-cluster/tasks/launch_instances.yml
+++ b/playbooks/gce/openshift-cluster/tasks/launch_instances.yml
@@ -20,22 +20,37 @@
- host-type-{{ type }}
- sub-host-type-{{ g_sub_host_type }}
- env-host-type-{{ cluster }}-openshift-{{ type }}
- when: instances |length > 0
+ when: instances |length > 0
register: gce
+- set_fact:
+ node_label:
+ # There doesn't seem to be a way to get the region directly, so parse it out of the zone.
+ region: "{{ gce.zone | regex_replace('^(.*)-.*$', '\\\\1') }}"
+ type: "{{ g_sub_host_type }}"
+ when: instances |length > 0 and type == "node"
+
+- set_fact:
+ node_label:
+ # There doesn't seem to be a way to get the region directly, so parse it out of the zone.
+ region: "{{ gce.zone | regex_replace('^(.*)-.*$', '\\\\1') }}"
+ type: "{{ type }}"
+ when: instances |length > 0 and type != "node"
+
- name: Add new instances to groups and set variables needed
add_host:
hostname: "{{ item.name }}"
- ansible_ssh_host: "{{ item.name }}"
+ ansible_ssh_host: "{{ item.public_ip }}"
ansible_ssh_user: "{{ deployment_vars[deployment_type].ssh_user | default(ansible_ssh_user, true) }}"
ansible_sudo: "{{ deployment_vars[deployment_type].sudo }}"
groups: "{{ item.tags | oo_prepend_strings_in_list('tag_') | join(',') }}"
gce_public_ip: "{{ item.public_ip }}"
gce_private_ip: "{{ item.private_ip }}"
+ openshift_node_labels: "{{ node_label }}"
with_items: gce.instance_data | default([], true)
- name: Wait for ssh
- wait_for: port=22 host={{ item.name }}
+ wait_for: port=22 host={{ item.public_ip }}
with_items: gce.instance_data | default([], true)
- name: Wait for user setup