tripleo-upgrade/tests/workarounds-upgrade
Jose Luis Franco Arza 5d1bf944d6 Allow applying workaround patches in containers.
The current workarounds mechanism allows applying a patch
into a host, usually the Undercloud. With the containerization
of both undercloud and overcloud a new need arises, the option to apply a
patch into a container or list of containers.

This patch adds new workarounds field to apply modifications to overcloud or undercloud containers using tripleo container image prepare[1]. The workaround mechanism takes a ContainerImagePrepare
file and adds desired modifications on top of it. After building containers, modified containers
parameters file are added to desired update or upgrade scripts to update TripleO Heat Templates before update/upgrade run. This way changes in containers are persistent. There is also field 'preparation_commands'
to execute some pre container image prepare commands, for example to download rpms or create custom Dockerfile.

pre_undercloud_update_workarounds:
    - rhbz1:
        patch: false
        containers: true
        environment: undercloud
        preparation_commands: |
          echo "Updates undercloud containers command"
        containers_file_modifications:
          modify_role: tripleo-modify-image
          includes:
          - ironic-inspector
          modify_append_tag: "-updated"
          modify_vars:
            tasks_from: yum_update.yml
            compare_host_packages: true
            yum_repos_dir_path: /etc/yum.repos.d

pre_overcloud_update_prepare_workarounds:
    - rhbz11:
        patch: false
        containers: true
        environment: overcloud
        deploy_scripts: overcloud_update_prepare.sh,overcloud_update_converge.sh
        preparation_commands: |
          echo "Updates overcloud containers command"
        containers_file_modifications:
          modify_role: tripleo-modify-image
          includes:
          - rabbitmq
          - haproxy
          - maria
          - redis
          modify_append_tag: "-updated"
          modify_vars:
            tasks_from: yum_update.yml
            compare_host_packages: true
            yum_repos_dir_path: /etc/yum.repos.d

#Only supports python source projects
pre_overcloud_update_prepare_workarounds:
    - rhbz11:
        patch: false
        containers: true
        environment: overcloud
        deploy_scripts: overcloud_update_prepare.sh,overcloud_update_converge.sh
        preparation_commands: ""
        containers_file_modifications:
          modify_role: tripleo-modify-image
          includes:
          - heat-api
          modify_append_tag: "-modified"
          modify_vars:
            tasks_from: dev_install.yml
            source_image: docker.io/tripleomaster/centos-binary-heat-api:current-tripleo
            refspecs:
              -
                project: heat
                refspec: refs/changes/12/1234/3

Change-Id: I4f8151f003d7636c3b34158e32ee62047f008129
[1] https://docs.openstack.org/project-deploy-guide/tripleo-docs/latest/deployment/container_image_prepare.html#modifying-images-during-prepare
2021-08-23 12:36:16 +00:00

62 lines
1.7 KiB
Plaintext

---
pre_undercloud_upgrade_workarounds:
- rhbz1:
patch: true
basedir: /home/stack/
patch_strip: 2
id: 112233
command:
- rhbz2:
patch: false
basedir: ''
id: ''
command: 'some command goes here'
- rhbz3:
patch: false
containers: true
environment: undercloud
preparation_commands: |
echo "Updates undercloud containers command"
containers_file_modification:
modify_role: tripleo-modify-image
includes:
- ironic-inspector
modify_append_tag: "-updated"
modify_vars:
tasks_from: yum_update.yml
compare_host_packages: true
yum_repos_dir_path: /etc/yum.repos.d
pre_overcloud_upgrade_prepare_workarounds:
- rhbz4:
patch: false
containers: true
environment: overcloud
deploy_scripts: overcloud_upgrade_prepare.sh,overcloud_upgrade_converge.sh
preparation_commands: |
echo "Updates overcloud containers command"
containers_file_modifications:
modify_role: tripleo-modify-image
includes:
- rabbitmq
- haproxy
- maria
- redis
modify_append_tag: "-updated"
modify_vars:
tasks_from: yum_update.yml
compare_host_packages: true
yum_repos_dir_path: /etc/yum.repos.d
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'