diff options
author | Thomas Wiest <twiest@redhat.com> | 2015-10-12 15:29:35 -0400 |
---|---|---|
committer | Thomas Wiest <twiest@redhat.com> | 2015-10-14 10:30:37 -0400 |
commit | ccf9acd9dad5c9dc2e1640f417a9109c9042a689 (patch) | |
tree | 8154ec29cd5327e28530b195b71e6ea40fe8a193 /playbooks/gce/openshift-cluster/tasks | |
parent | f1b82648b06f393dfc960a4fc1f5bbe5b97b608a (diff) | |
download | openshift-ccf9acd9dad5c9dc2e1640f417a9109c9042a689.tar.gz openshift-ccf9acd9dad5c9dc2e1640f417a9109c9042a689.tar.bz2 openshift-ccf9acd9dad5c9dc2e1640f417a9109c9042a689.tar.xz openshift-ccf9acd9dad5c9dc2e1640f417a9109c9042a689.zip |
Fixed GCE playbooks so that they're more like the AWS playbooks.
Namely the GCE playbooks now:
- Create infra nodes
- Correctly label nodes in OpenShift
- Setup masters as nodes as well (needed for sdn)
- Removed set_infra_launch_facts_tasks.yml as it's not used anymore.
Diffstat (limited to 'playbooks/gce/openshift-cluster/tasks')
-rw-r--r-- | playbooks/gce/openshift-cluster/tasks/launch_instances.yml | 21 |
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 |