-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Fixed GCE playbooks so that they're more like the AWS playbooks. #688
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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" | ||
|
|
||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Followup issue to move logrotate bits out of GCE/AWS specific playbooks and into more a common playbook?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 on moving to a more common playbook in the future
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| - 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 | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fail at this step while deploying with 0 infra node.
In fact we skip the launch of infra instances in the code above, however this code is executed.
We should check again that
instances|length >0