Apply changes to cluster using updated inventory

It could cause issue when being on inventory containing nodes marked as
new.

Specifically, it caused an undefined ansible variable error when
re-running the deploy playbook on an inventory that contained nodes in
the new_masters group.

Closes-Bug: #1812962
Change-Id: Iaf9403b5f60f06769d94317d261de8cad94274ab
This commit is contained in:
Martin André 2019-01-22 18:08:14 +01:00
parent ff36d44af5
commit 8a818ab226
1 changed files with 25 additions and 11 deletions

View File

@ -437,17 +437,6 @@ outputs:
- import_playbook: "{{openshift_worker_scaleup_playbook_path}}"
{% endif %}
{% endif %}
# Re-run the deploy playbook to apply potential change
# changes to existing nodes
- import_playbook: "{{openshift_ansible_playbook_path}}"
- name: Restart masters
hosts: masters
serial: 1
tasks:
- import_role:
name: /usr/share/ansible/openshift-ansible/roles/openshift_control_plane
tasks_from: restart.yml
{% endif %}
- name: set openshift command
@ -553,6 +542,31 @@ outputs:
{{openshift_master_node_vars | to_nice_yaml() | indent(6)}}
{% endif %}
- when: tripleo_stack_action == 'UPDATE'
block:
- name: generate openshift playbook
copy:
dest: "{{playbook_dir}}/openshift/playbook.yml"
content: |
# Re-run the deploy playbook to apply potential change
# changes to existing nodes
- import_playbook: "{{openshift_ansible_playbook_path}}"
- name: Restart masters
hosts: masters
serial: 1
tasks:
- import_role:
name: /usr/share/ansible/openshift-ansible/roles/openshift_control_plane
tasks_from: restart.yml
- name: print openshift command
debug:
var: openshift_command
- name: run openshift (immediate log at {{playbook_dir}}/openshift/playbook.log)
shell: |
{{openshift_command}} 2>&1 | tee {{playbook_dir}}/openshift/playbook.log
exit ${PIPESTATUS[0]}
- name: generate openshift validation playbook
copy:
dest: "{{playbook_dir}}/openshift/playbook.yml"