Add the possibility to provide a custom UpgradeInitCommand.

In order to not have to deploy «manually» the repo on the overcloud
before upgrade.

This will create a template with the specified commands and add it to
the list of templates during upgrade.

Change-Id: I3838d95358522113ef869dfc99d716728f4bf80e
This commit is contained in:
Sofer Athlan-Guyot 2017-11-08 10:28:00 +01:00 committed by Jose Luis Franco Arza
parent 4fca939b11
commit 8067d83dcb
4 changed files with 22 additions and 1 deletions

View File

@ -12,7 +12,7 @@ This role requires:
* Nodes in the inventory file are placed in groups based on their roles (e.g compute nodes are part of the 'compute' group)
* Repositories containing packages to be upgraded are already installed on undercloud and overcloud nodes
* Repositories containing packages to be upgraded are already installed on undercloud and overcloud nodes (or, for overcloud, define an upgrade_init_command variable)
* The initial overcloud deploy command is placed in a script file located in the path set by the overcloud_deploy_script var. Each option/environment file should be placed on a separate new line, e.g:
@ -111,6 +111,11 @@ Amount of memory assigned for the workload instance.
Set to true when running the role in the TripleO CI jobs. It avoids losing connectivity to the undercloud by skipping reboot and ssh kill tasks.
upgrade_init_command: |
sudo tripleo-repos -b pike current
Bash commands, defines a custom upgrade init to be taken into account during overcloud upgrade.
Dependencies
------------

View File

@ -122,3 +122,8 @@ upgrade_remove_rpm: false
# Enable HCI upgrade
upgrade_hci: false
# No upgrade_init_command by default
upgrade_init_command_template: upgrade_init_command.yaml.j2
upgrade_init_command_dest: "{{working_dir}}/UpgradeInitCommand.yaml"
upgrade_init_command: false

View File

@ -152,6 +152,13 @@
dest: "{{ working_dir }}/upgrade_hci.yaml"
when: upgrade_hci|bool
- name: create the custom upgrade init commands
template:
src: "{{ upgrade_init_command_template }}"
dest: "{{upgrade_init_command_dest}}"
mode: 0775
when: upgrade_init_command is string
- name: create composable upgrade scripts
include: step_upgrade.yml
loop_control:
@ -160,6 +167,7 @@
- step: "Docker containers composable upgrade"
script: "{{ overcloud_composable_upgrade_script }}"
environment_file:
- "{% if upgrade_init_command is string %}{{upgrade_init_command_dest}}{% endif %}"
- "{% if upstream_container_images %}{{ tht_directory }}/environments/docker.yaml{% endif %}"
- "{% if upstream_container_images and (deployment_with_ha.rc == 0) %}{{ tht_directory }}/environments/docker-ha.yaml{% endif %}"
- "{{ tht_directory }}/environments/major-upgrade-composable-steps-docker.yaml"

View File

@ -0,0 +1,3 @@
parameter_defaults:
UpgradeInitCommand: |
{{ upgrade_init_command|indent(width=4,first=False) }}