Sync up upgrades and updates workarounds mechanism.
Up to now, the minor updates workarounds was not being used very much
being a little bit left away in comparision with what it was implemented
for the upgrades one. This patch allows minor updates to benefit from
the same workarounds mechanism, at the same time that any improvement
in the upgrades mechanism will be available for updates too.
Also, it was removed the references to the {{ working_dir }} variable
in those shell tasks which have the argument changing directory to that
very same {{ working_dir }}, mostly to simplify the tasks and remove
redundancy.
Change-Id: Ibc57c51ff19ebad093c887bee545ca6a7d51827f
(cherry picked from commit ef15456503
)
This commit is contained in:
parent
7d769026ce
commit
16b698553b
|
@ -77,22 +77,11 @@ overcloud_upgrade_converge_script: "{{ working_dir }}/overcloud_upgrade_converge
|
|||
workload_launch_script: "{{ working_dir }}/workload_launch.sh"
|
||||
|
||||
# overcloud jinja template name
|
||||
overcloud_pre_update_workarounds_template: overcloud_pre_update_workarounds.sh.j2
|
||||
update_workarounds_template: update_workarounds.sh.j2
|
||||
overcloud_update_prepare_template: overcloud_update_prepare.sh.j2
|
||||
overcloud_update_run_template: overcloud_update_run.sh.j2
|
||||
overcloud_update_converge_template: overcloud_update_converge.sh.j2
|
||||
|
||||
# overcloud update scripts
|
||||
pre_undercloud_update_workarounds_script: "{{ working_dir }}/pre_undercloud_update_workarounds.sh"
|
||||
post_undercloud_update_workarounds_script: "{{ working_dir }}/post_undercloud_update_workarounds.sh"
|
||||
pre_overcloud_update_prepare_workarounds_script: "{{ working_dir }}/pre_overcloud_update_prepare_workarounds.sh"
|
||||
post_overcloud_update_prepare_workarounds_script: "{{ working_dir }}/post_overcloud_update_prepare_workarounds.sh"
|
||||
pre_overcloud_update_run_workarounds_script: "{{ working_dir }}/pre_overcloud_update_run_workarounds.sh"
|
||||
post_overcloud_update_run_workarounds_script: "{{ working_dir }}/post_overcloud_update_run_workarounds.sh"
|
||||
pre_overcloud_update_converge_workarounds_script: "{{ working_dir }}/pre_overcloud_update_converge_workarounds.sh"
|
||||
post_overcloud_update_converge_workarounds_script: "{{ working_dir }}/post_overcloud_update_converge_workarounds.sh"
|
||||
|
||||
overcloud_update_prepare_script: "{{ working_dir }}/overcloud_update_prepare.sh"
|
||||
overcloud_update_run_script_base: "{{ working_dir }}/overcloud_update_run"
|
||||
overcloud_update_converge_script: "{{ working_dir }}/overcloud_update_converge.sh"
|
||||
|
|
|
@ -14,19 +14,19 @@
|
|||
- name: get auxiliary facts for major upgrades
|
||||
import_tasks: ../common/auxilary-facts.yaml
|
||||
|
||||
- name: create scripts with workarounds
|
||||
- name: create update workaround scripts
|
||||
template:
|
||||
src: "{{ update_workarounds_template }}"
|
||||
dest: "{{ working_dir }}/{{ item.script }}"
|
||||
mode: 0755
|
||||
src: workarounds.sh.j2
|
||||
dest: "{{ working_dir }}/{{ item }}.sh"
|
||||
mode: 0775
|
||||
force: true
|
||||
loop:
|
||||
- '{{ pre_overcloud_update_prepare_workarounds|default([]) }}'
|
||||
- '{{ post_overcloud_update_prepare_workarounds|default([]) }}'
|
||||
- '{{ pre_overcloud_update_run_workarounds|default([]) }}'
|
||||
- '{{ post_overcloud_update_run_workarounds|default([]) }}'
|
||||
- '{{ pre_overcloud_update_converge_workarounds|default([]) }}'
|
||||
- '{{ post_overcloud_update_converge_workarounds|default([]) }}'
|
||||
- 'pre_overcloud_update_prepare_workarounds'
|
||||
- 'post_overcloud_update_prepare_workarounds'
|
||||
- 'pre_overcloud_update_run_workarounds'
|
||||
- 'post_overcloud_update_run_workarounds'
|
||||
- 'pre_overcloud_update_converge_workarounds'
|
||||
- 'post_overcloud_update_converge_workarounds'
|
||||
when: updates_workarounds|bool
|
||||
|
||||
- name: include l3 agent tasks
|
||||
|
|
|
@ -6,12 +6,13 @@
|
|||
mode: 0775
|
||||
force: true
|
||||
|
||||
- name: create scripts with workarounds
|
||||
- name: create update workaround scripts for undercloud
|
||||
template:
|
||||
src: "{{ update_workarounds_template }}"
|
||||
dest: "{{ working_dir }}/{{ item.script }}"
|
||||
mode: 0755
|
||||
src: workarounds.sh.j2
|
||||
dest: "{{ working_dir }}/{{ item }}.sh"
|
||||
mode: 0775
|
||||
force: true
|
||||
loop: '{{ pre_undercloud_update_workarounds|default([])
|
||||
+ post_undercloud_update_workarounds|default([]) }}'
|
||||
loop:
|
||||
- 'pre_undercloud_update_workarounds'
|
||||
- 'post_undercloud_update_workarounds'
|
||||
when: updates_workarounds|bool
|
||||
|
|
|
@ -9,13 +9,17 @@
|
|||
when: update_noop|bool or undercloud_update|bool
|
||||
|
||||
- block:
|
||||
- name: undercloud pre-update workarounds
|
||||
- name: apply pre undercloud update workarounds
|
||||
shell: |
|
||||
set -o pipefail
|
||||
source {{ undercloud_rc }}
|
||||
bash {{ pre_undercloud_update_workarounds_script }} 2>&1 {{ timestamper_cmd }} > \
|
||||
{{ working_dir }}/uc_pre_update_workarounds.log
|
||||
bash pre_undercloud_update_workarounds.sh 2>&1 {{ timestamper_cmd }} > \
|
||||
pre_undercloud_update_workarounds.log
|
||||
args:
|
||||
chdir: "{{ working_dir }}"
|
||||
when: updates_workarounds|bool
|
||||
tags:
|
||||
- undercloud_update
|
||||
|
||||
- name: update undercloud
|
||||
shell: |
|
||||
|
@ -24,13 +28,17 @@
|
|||
{{ working_dir }}/undercloud_update.log
|
||||
tags: undercloud_update
|
||||
|
||||
- name: undercloud post-update workarounds
|
||||
- name: apply post undercloud update workarounds
|
||||
shell: |
|
||||
set -o pipefail
|
||||
source {{ undercloud_rc }}
|
||||
bash {{ post_undercloud_update_workarounds_script }} 2>&1 {{ timestamper_cmd }} > \
|
||||
{{ working_dir }}/uc_pre_update_workarounds.log
|
||||
bash post_undercloud_update_workarounds.sh 2>&1 {{ timestamper_cmd }} > \
|
||||
post_undercloud_update_workarounds.log
|
||||
args:
|
||||
chdir: "{{ working_dir }}"
|
||||
when: updates_workarounds|bool
|
||||
tags:
|
||||
- undercloud_update
|
||||
|
||||
- name: validate undercloud update
|
||||
import_tasks: ../common/undercloud_validate_upgrade.yaml
|
||||
|
@ -48,64 +56,86 @@
|
|||
when: update_noop|bool or overcloud_update|bool
|
||||
|
||||
- block:
|
||||
- name: overcloud pre-update prepare workarounds
|
||||
- name: apply pre overcloud update prepare workarounds
|
||||
shell: |
|
||||
set -o pipefail
|
||||
source {{ undercloud_rc }}
|
||||
bash {{ pre_overcloud_update_prepare_workarounds_script }} 2>&1 {{ timestamper_cmd }} > \
|
||||
{{ working_dir }}/pre_overcloud_update_prepare_workarounds.log
|
||||
bash pre_overcloud_update_prepare_workarounds.sh 2>&1 {{ timestamper_cmd }} > \
|
||||
pre_overcloud_update_prepare_workarounds.log
|
||||
args:
|
||||
chdir: "{{ working_dir }}"
|
||||
when: updates_workarounds|bool
|
||||
tags:
|
||||
- overcloud_update_prepare
|
||||
|
||||
- name: import oc update prepare tasks
|
||||
import_tasks: overcloud_update_prepare.yml
|
||||
tags:
|
||||
- overcloud_update
|
||||
- overcloud_update_prepare
|
||||
|
||||
- name: overcloud post-update prepare workarounds
|
||||
- name: apply post overcloud update prepare workarounds
|
||||
shell: |
|
||||
set -o pipefail
|
||||
source {{ undercloud_rc }}
|
||||
bash {{ post_overcloud_update_prepare_workarounds_script }} 2>&1 {{ timestamper_cmd }} > \
|
||||
{{ working_dir }}/post_overcloud_update_prepare_workarounds.log
|
||||
bash post_overcloud_update_prepare_workarounds.sh 2>&1 {{ timestamper_cmd }} > \
|
||||
post_overcloud_update_prepare_workarounds.log
|
||||
args:
|
||||
chdir: "{{ working_dir }}"
|
||||
when: updates_workarounds|bool
|
||||
tags:
|
||||
- overcloud_update_prepare
|
||||
|
||||
- name: Ensure ansible-pacemaker module is present in CI.
|
||||
yum:
|
||||
name: ansible-pacemaker
|
||||
state: latest
|
||||
when: tripleo_ci|default(false)|bool
|
||||
tags: overcloud_update
|
||||
become: true
|
||||
tags:
|
||||
- overcloud_update_run
|
||||
|
||||
- name: overcloud pre-update run workarounds
|
||||
- name: apply pre overcloud update run workarounds
|
||||
shell: |
|
||||
set -o pipefail
|
||||
source {{ undercloud_rc }}
|
||||
bash {{ pre_overcloud_update_run_workarounds_script }} 2>&1 {{ timestamper_cmd }} > \
|
||||
{{ working_dir }}/pre_overcloud_update_run_workarounds.log
|
||||
bash pre_overcloud_update_run_workarounds.sh 2>&1 {{ timestamper_cmd }} > \
|
||||
pre_overcloud_update_run_workarounds.log
|
||||
args:
|
||||
chdir: "{{ working_dir }}"
|
||||
when: updates_workarounds|bool
|
||||
tags:
|
||||
- overcloud_update_run
|
||||
|
||||
- name: import overcloud update run tasks
|
||||
import_tasks: overcloud_update_run.yml
|
||||
tags:
|
||||
- overcloud_update
|
||||
- overcloud_update_run
|
||||
|
||||
- name: overcloud post-update run workarounds
|
||||
- name: apply post overcloud update run workarounds
|
||||
shell: |
|
||||
set -o pipefail
|
||||
source {{ undercloud_rc }}
|
||||
bash {{ post_overcloud_update_run_workarounds_script }} 2>&1 {{ timestamper_cmd }} > \
|
||||
{{ working_dir }}/post_overcloud_update_run_workarounds.log
|
||||
bash post_overcloud_update_run_workarounds.sh 2>&1 {{ timestamper_cmd }} > \
|
||||
post_overcloud_update_run_workarounds.log
|
||||
args:
|
||||
chdir: "{{ working_dir }}"
|
||||
when: updates_workarounds|bool
|
||||
tags:
|
||||
- overcloud_update_run
|
||||
|
||||
- name: update Ceph
|
||||
include_tasks: ceph_update_run.yml
|
||||
when: ceph_osd_enabled|bool
|
||||
|
||||
- name: apply pre overcloud update converge workarounds
|
||||
command: "{{ working_dir }}/pre_overcloud_update_converge_workarounds.sh"
|
||||
when: updates_workarounds
|
||||
shell: |
|
||||
set -o pipefail
|
||||
source {{ undercloud_rc }}
|
||||
bash pre_overcloud_update_converge_workarounds.sh 2>&1 {{ timestamper_cmd }} > \
|
||||
pre_overcloud_update_converge_workarounds.log
|
||||
args:
|
||||
chdir: "{{ working_dir }}"
|
||||
when: updates_workarounds|bool
|
||||
tags: overcloud_update_converge
|
||||
|
||||
- name: import overcloud update converge tasks
|
||||
|
@ -113,8 +143,14 @@
|
|||
tags: overcloud_update_converge
|
||||
|
||||
- name: apply post overcloud update converge workarounds
|
||||
command: "{{ working_dir }}/post_overcloud_update_converge_workarounds.sh"
|
||||
when: updates_workarounds
|
||||
shell: |
|
||||
set -o pipefail
|
||||
source {{ undercloud_rc }}
|
||||
bash post_overcloud_update_converge_workarounds.sh 2>&1 {{ timestamper_cmd }} > \
|
||||
post_overcloud_update_converge_workarounds.log
|
||||
args:
|
||||
chdir: "{{ working_dir }}"
|
||||
when: updates_workarounds|bool
|
||||
tags: overcloud_update_converge
|
||||
|
||||
- name: validate overcloud docker images/containers
|
||||
|
@ -125,7 +161,7 @@
|
|||
{{ working_dir }}/validate_oc_images_containers.log
|
||||
when: overcloud_images_validate|bool
|
||||
tags:
|
||||
- overcloud_update
|
||||
- overcloud_images_validate
|
||||
|
||||
- name: import nova_actions_check tasks
|
||||
import_tasks: ../common/nova_actions_check.yml
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
src: workarounds.sh.j2
|
||||
dest: "{{ working_dir }}/{{ item }}.sh"
|
||||
mode: 0775
|
||||
force: true
|
||||
loop:
|
||||
- 'pre_overcloud_upgrade_prepare_workarounds'
|
||||
- 'post_overcloud_upgrade_prepare_workarounds'
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
- name: apply pre undercloud upgrade workarounds
|
||||
shell: |
|
||||
set -o pipefail
|
||||
bash {{ working_dir }}/pre_undercloud_upgrade_workarounds.sh 2>&1 {{ timestamper_cmd }} > pre_undercloud_upgrade_workarounds.log
|
||||
bash pre_undercloud_upgrade_workarounds.sh 2>&1 {{ timestamper_cmd }} > pre_undercloud_upgrade_workarounds.log
|
||||
args:
|
||||
chdir: "{{ working_dir }}"
|
||||
when: upgrade_workarounds
|
||||
|
@ -31,7 +31,7 @@
|
|||
- name: apply post undercloud upgrade workarounds
|
||||
shell: |
|
||||
set -o pipefail
|
||||
bash {{ working_dir }}/post_undercloud_upgrade_workarounds.sh 2>&1 {{ timestamper_cmd }} > post_undercloud_upgrade_workarounds.log
|
||||
bash post_undercloud_upgrade_workarounds.sh 2>&1 {{ timestamper_cmd }} > post_undercloud_upgrade_workarounds.log
|
||||
args:
|
||||
chdir: "{{ working_dir }}"
|
||||
when: upgrade_workarounds
|
||||
|
@ -50,7 +50,7 @@
|
|||
- name: apply pre overcloud upgrade prepare workarounds
|
||||
shell: |
|
||||
set -o pipefail
|
||||
bash {{ working_dir }}/pre_overcloud_upgrade_prepare_workarounds.sh 2>&1 {{ timestamper_cmd }} > pre_overcloud_upgrade_prepare_workarounds.log
|
||||
bash pre_overcloud_upgrade_prepare_workarounds.sh 2>&1 {{ timestamper_cmd }} > pre_overcloud_upgrade_prepare_workarounds.log
|
||||
args:
|
||||
chdir: "{{ working_dir }}"
|
||||
when: upgrade_workarounds
|
||||
|
@ -62,7 +62,7 @@
|
|||
- name: apply post overcloud upgrade prepare workarounds
|
||||
shell: |
|
||||
set -o pipefail
|
||||
bash {{ working_dir }}/post_overcloud_upgrade_prepare_workarounds.sh 2>&1 {{ timestamper_cmd }} > post_overcloud_upgrade_prepare_workarounds.log
|
||||
bash post_overcloud_upgrade_prepare_workarounds.sh 2>&1 {{ timestamper_cmd }} > post_overcloud_upgrade_prepare_workarounds.log
|
||||
args:
|
||||
chdir: "{{ working_dir }}"
|
||||
when: upgrade_workarounds
|
||||
|
@ -108,7 +108,7 @@
|
|||
- name: apply pre Ceph upgrade workarounds
|
||||
shell: |
|
||||
set -o pipefail
|
||||
bash {{ working_dir }}/pre_ceph_upgrade_workarounds.sh 2>&1 {{ timestamper_cmd }} > pre_ceph_upgrade_workarounds.log
|
||||
bash pre_ceph_upgrade_workarounds.sh 2>&1 {{ timestamper_cmd }} > pre_ceph_upgrade_workarounds.log
|
||||
args:
|
||||
chdir: "{{working_dir}}"
|
||||
when: upgrade_workarounds
|
||||
|
@ -120,7 +120,7 @@
|
|||
- name: apply post Ceph upgrade workarounds
|
||||
shell: |
|
||||
set -o pipefail
|
||||
bash {{ working_dir }}/post_ceph_upgrade_workarounds.sh 2>&1 {{ timestamper_cmd }} > post_ceph_upgrade_workarounds.log
|
||||
bash post_ceph_upgrade_workarounds.sh 2>&1 {{ timestamper_cmd }} > post_ceph_upgrade_workarounds.log
|
||||
args:
|
||||
chdir: "{{ working_dir }}"
|
||||
when: upgrade_workarounds
|
||||
|
@ -128,7 +128,7 @@
|
|||
- name: apply pre overcloud upgrade converge workarounds
|
||||
shell: |
|
||||
set -o pipefail
|
||||
bash {{ working_dir }}/pre_overcloud_upgrade_converge_workarounds.sh 2>&1 {{ timestamper_cmd }} > pre_overcloud_upgrade_converge_workarounds.log
|
||||
bash pre_overcloud_upgrade_converge_workarounds.sh 2>&1 {{ timestamper_cmd }} > pre_overcloud_upgrade_converge_workarounds.log
|
||||
args:
|
||||
chdir: "{{ working_dir }}"
|
||||
when: upgrade_workarounds
|
||||
|
@ -140,7 +140,7 @@
|
|||
- name: apply post overcloud upgrade converge workarounds
|
||||
shell: |
|
||||
set -o pipefail
|
||||
bash {{ working_dir }}/post_overcloud_upgrade_converge_workarounds.sh 2>&1 {{ timestamper_cmd }} > post_overcloud_upgrade_converge_workarounds.log
|
||||
bash post_overcloud_upgrade_converge_workarounds.sh 2>&1 {{ timestamper_cmd }} > post_overcloud_upgrade_converge_workarounds.log
|
||||
args:
|
||||
chdir: "{{ working_dir }}"
|
||||
when: upgrade_workarounds
|
||||
|
|
|
@ -20,9 +20,9 @@ function apply_patch {
|
|||
|
||||
if sudo patch --dry-run --reverse --force -d ${patch_dir} -p1 < ${temp_dir}/patch.txt >/dev/null 2>&1
|
||||
then
|
||||
echo "Patch ${patch_id} already applied, skipping"
|
||||
else
|
||||
sudo patch -Ns -d ${patch_dir} -p1 < ${temp_dir}/patch.txt
|
||||
else
|
||||
echo "Patch ${patch_id} already applied, skipping"
|
||||
fi
|
||||
|
||||
sudo rm -Rf ${temp_dir}/
|
||||
|
@ -45,6 +45,7 @@ apply_patch {{ value.basedir }} {{ value.id }}
|
|||
{% endif -%}
|
||||
{% endmacro -%}
|
||||
|
||||
{% if upgrade_workarounds|bool -%}
|
||||
{{ render_workarounds(pre_undercloud_upgrade_workarounds|default([]),'pre_undercloud_upgrade_workarounds') }}
|
||||
{# finish pre_undercloud_upgrade_workarounds #}
|
||||
{{ render_workarounds(post_undercloud_upgrade_workarounds|default([]),'post_undercloud_upgrade_workarounds') }}
|
||||
|
@ -65,3 +66,24 @@ apply_patch {{ value.basedir }} {{ value.id }}
|
|||
{# finish pre_ceph_upgrade_workarounds #}
|
||||
{{ render_workarounds(post_ceph_upgrade_workarounds|default([]),'post_ceph_upgrade_workarounds') }}
|
||||
{# finish post_ceph_upgrade_workarounds #}
|
||||
{% endif -%}
|
||||
|
||||
{% if updates_workarounds|bool -%}
|
||||
# Render for Updates
|
||||
{{ render_workarounds(pre_undercloud_update_workarounds|default([]),'pre_undercloud_update_workarounds') }}
|
||||
{# finish pre_undercloud_update_workarounds #}
|
||||
{{ render_workarounds(post_undercloud_update_workarounds|default([]),'post_undercloud_update_workarounds') }}
|
||||
{# finish post_undercloud_update_workarounds #}
|
||||
{{ render_workarounds(pre_overcloud_update_prepare_workarounds|default([]),'pre_overcloud_update_prepare_workarounds') }}
|
||||
{# finish pre_overcloud_update_prepare_workarounds #}
|
||||
{{ render_workarounds(post_overcloud_update_prepare_workarounds|default([]),'post_overcloud_update_prepare_workarounds') }}
|
||||
{# finish post_overcloud_update_prepare_workarounds #}
|
||||
{{ render_workarounds(pre_overcloud_update_run_workarounds|default([]),'pre_overcloud_update_run_workarounds') }}
|
||||
{# finish pre_overcloud_update_run_workarounds #}
|
||||
{{ render_workarounds(post_overcloud_update_run_workarounds|default([]),'post_overcloud_update_run_workarounds') }}
|
||||
{# finish post_overcloud_update_run_workarounds #}
|
||||
{{ render_workarounds(pre_overcloud_update_converge_workarounds|default([]),'pre_overcloud_update_converge_workarounds') }}
|
||||
{# finish pre_overcloud_update_converge_workarounds #}
|
||||
{{ render_workarounds(post_overcloud_update_converge_workarounds|default([]),'post_overcloud_update_converge_workarounds') }}
|
||||
{# finish post_overcloud_update_converge_workarounds #}
|
||||
{% endif -%}
|
||||
|
|
|
@ -0,0 +1,40 @@
|
|||
---
|
||||
pre_undercloud_update_workarounds:
|
||||
- rhbz1:
|
||||
patch: true
|
||||
basedir: /usr/share/openstack-tripleo-heat-templates
|
||||
id: 112345
|
||||
command:
|
||||
- rhbz2:
|
||||
patch: true
|
||||
basedir: /usr/share/openstack-tripleo-heat-templates
|
||||
id: 212321
|
||||
command:
|
||||
- rhbz3:
|
||||
patch: false
|
||||
basedir: ''
|
||||
id: ''
|
||||
command: 'some command goes here'
|
||||
post_undercloud_update_workarounds:
|
||||
- rhbz10:
|
||||
patch: false
|
||||
basedir: ''
|
||||
id: ''
|
||||
command: |
|
||||
echo "This is a nice workaround"
|
||||
pre_overcloud_update_run_workarounds:
|
||||
- rhbz11:
|
||||
patch: false
|
||||
basedir: ''
|
||||
id: ''
|
||||
ansible_hosts: "overcloud"
|
||||
command: |
|
||||
cat /etc/redhat-release
|
||||
post_overcloud_update_converge_workarounds:
|
||||
- rhbz12:
|
||||
patch: false
|
||||
basedir: ''
|
||||
id: ''
|
||||
ansible_hosts: "overcloud"
|
||||
command: |
|
||||
echo "Update finished, awesome!"
|
|
@ -0,0 +1,30 @@
|
|||
---
|
||||
pre_undercloud_upgrade_workarounds:
|
||||
- rhbz1:
|
||||
patch: true
|
||||
basedir: /home/stack/
|
||||
id: 112233
|
||||
command:
|
||||
- rhbz2:
|
||||
patch: true
|
||||
basedir: /home/stack/
|
||||
id: 112234
|
||||
command:
|
||||
- rhbz3:
|
||||
patch: false
|
||||
basedir: ''
|
||||
id: ''
|
||||
command: 'some command goes here'
|
||||
post_undercloud_upgrade_workarounds:
|
||||
- rhbz10:
|
||||
patch: true
|
||||
basedir: /usr/share/
|
||||
id: 223344
|
||||
command: ''
|
||||
post_overcloud_upgrade_workarounds:
|
||||
- rhbz11:
|
||||
patch: false
|
||||
basedir: ''
|
||||
id: ''
|
||||
ansible_hosts: "overcloud"
|
||||
command: 'Ansible task to run in overcloud nodes'
|
Loading…
Reference in New Issue