diff options
author | Thomas Wiest <twiest@users.noreply.github.com> | 2015-10-12 14:37:44 -0400 |
---|---|---|
committer | Thomas Wiest <twiest@users.noreply.github.com> | 2015-10-12 14:37:44 -0400 |
commit | 35476982e1d0dc1851c102ab3b6aec0b9b6a1637 (patch) | |
tree | 0d7de94740f3fafe9eeb9754d5d438036f35e15a /playbooks/gce/openshift-cluster/tasks | |
parent | 8e776b09cb38c6f02aa4b3c75c9343e73fb96691 (diff) | |
parent | a8171a639bd4500f30e72233587e9f6335202438 (diff) | |
download | openshift-35476982e1d0dc1851c102ab3b6aec0b9b6a1637.tar.gz openshift-35476982e1d0dc1851c102ab3b6aec0b9b6a1637.tar.bz2 openshift-35476982e1d0dc1851c102ab3b6aec0b9b6a1637.tar.xz openshift-35476982e1d0dc1851c102ab3b6aec0b9b6a1637.zip |
Merge pull request #658 from menren/gce-support
GCE-support
Diffstat (limited to 'playbooks/gce/openshift-cluster/tasks')
-rw-r--r-- | playbooks/gce/openshift-cluster/tasks/launch_instances.yml | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/playbooks/gce/openshift-cluster/tasks/launch_instances.yml b/playbooks/gce/openshift-cluster/tasks/launch_instances.yml index 6307ecc27..e300b5b5a 100644 --- a/playbooks/gce/openshift-cluster/tasks/launch_instances.yml +++ b/playbooks/gce/openshift-cluster/tasks/launch_instances.yml @@ -10,33 +10,38 @@ service_account_email: "{{ lookup('env', 'gce_service_account_email_address') }}" pem_file: "{{ lookup('env', 'gce_service_account_pem_file_path') }}" project_id: "{{ lookup('env', 'gce_project_id') }}" + zone: "{{ lookup('env', 'zone') }}" + network: "{{ lookup('env', 'network') }}" +# unsupported in 1.9.+ + #service_account_permissions: "datastore,logging-write" tags: - created-by-{{ lookup('env', 'LOGNAME') |default(cluster, true) }} - env-{{ cluster }} - host-type-{{ type }} - - sub-host-type-{{ sub_host_type }} + - sub-host-type-{{ g_sub_host_type }} - env-host-type-{{ cluster }}-openshift-{{ type }} + when: instances |length > 0 register: gce - name: Add new instances to groups and set variables needed add_host: hostname: "{{ item.name }}" - ansible_ssh_host: "{{ item.public_ip }}" + ansible_ssh_host: "{{ item.name }}" 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 }}" - with_items: gce.instance_data + with_items: gce.instance_data | default([], true) - name: Wait for ssh - wait_for: port=22 host={{ item.public_ip }} - with_items: gce.instance_data + wait_for: port=22 host={{ item.name }} + with_items: gce.instance_data | default([], true) - 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" register: result until: result.rc == 0 - retries: 20 - delay: 10 - with_items: gce.instance_data + retries: 30 + delay: 5 + with_items: gce.instance_data | default([], true) |