Rework the generated openshift-ansible playbook

The `prerequisites.yml` playbook should only be explicitly run on
initial deployment to prepare the nodes. It is already included in the
scaleup playbooks for the new nodes so there is no need to include it
again. Re-running the `prerequisites.yml` playbook reconfigures the
container runtime and may cause outage, it is supposed to be run only
once.

Make update and upgrade playbooks exclusive. There is no need to run
both of them.

Add comments to clarify the intent for each playbooks.

Change-Id: I30278360fcc1ffa9bd7ce7cb77d023629fb6fa47
Closes-Bug: #1804790
This commit is contained in:
Martin André 2018-11-23 11:08:36 +01:00
parent f1ce0b106b
commit bb1a1209ac
1 changed files with 18 additions and 3 deletions

View File

@ -344,17 +344,32 @@ outputs:
enabled: yes
{% if tripleo_stack_action == 'CREATE' %}
# Prerequisites playbook is explicitly needed only for
# initial install
- include: "{{openshift_prerequisites_playbook_path}}"
- include: "{{openshift_ansible_playbook_path}}"
{% if tripleo_stack_action == 'UPDATE' and has_new_nodes %}
{% elif tripleo_stack_action == 'UPDATE' %}
{% if has_new_nodes %}
- name: Restart dnsmasq to pick up new nodes
hosts: all
tasks:
- name: Restart dnsmasq
service:
name: dnsmasq
state: restarted
{% if new_master_nodes | count > 0 %}
# Scale up nodes (including masters)
- include: "{{openshift_master_scaleup_playbook_path}}"
{% else %}
# Scale up workers/infra nodes
- include: "{{openshift_worker_scaleup_playbook_path}}"
{% endif %}
{% endif %}
{% if tripleo_stack_action == 'CREATE' or (tripleo_stack_action == 'UPDATE' and has_new_nodes) %}
# Re-run the deploy playbook to apply potential change
# changes to existing nodes
- include: "{{openshift_ansible_playbook_path}}"
{% endif %}
@ -433,7 +448,7 @@ outputs:
copy:
dest: "{{playbook_dir}}/openshift/playbook.yml"
content: |
# Scale up etcd nodes
- include: "{{openshift_etcd_scaleup_playbook_path}}"
- name: print openshift command