Use different variables for deploy and upgrade scenarios

Introduce an upgrade_composable_scenario variable to hold the path to
the scenario file used in the upgrade command to differentiate with the
composable_scenario variable for the path of the scenario file used in
deploy command. Remove the deploy_composable_scenario variable that was
previously holding a boolean value, which can be inferred from the
content of the composable_scenario variable.

Reorder the arguments passed to the deploy command so that the default
from the docker.yaml environment doesn't overwrite the setting coming
from the scenario.

Co-Authored-By: Jiří Stránský <jistr@redhat.com>
Depends-On: Ie08bbe08530bd48a0ca58667f0704f360e0a4dd7
Change-Id: Iece70e22cd40cb119f2f9eb3c51be7bd4631fade
Related-Bug: #1714905
This commit is contained in:
Martin André 2017-09-04 14:29:48 +02:00 committed by Emilien Macchi
parent 6f173ab3c5
commit fe88bef95b
15 changed files with 32 additions and 17 deletions

View File

@ -9,7 +9,6 @@ overcloud_nodes:
composable_services: false
deploy_multinode: true
deploy_composable_scenario: true
composable_scenario: scenario001-multinode.yaml
network_isolation: false

View File

@ -9,7 +9,6 @@ overcloud_nodes:
composable_services: false
deploy_multinode: true
deploy_composable_scenario: true
composable_scenario: scenario002-multinode.yaml
network_isolation: false

View File

@ -9,7 +9,6 @@ overcloud_nodes:
composable_services: false
deploy_multinode: true
deploy_composable_scenario: true
composable_scenario: scenario003-multinode.yaml
network_isolation: false

View File

@ -9,7 +9,6 @@ overcloud_nodes:
composable_services: false
deploy_multinode: true
deploy_composable_scenario: true
composable_scenario: scenario004-multinode.yaml
network_isolation: false

View File

@ -13,7 +13,6 @@ overcloud_nodes:
composable_services: false
deploy_multinode: true
deploy_composable_scenario: true
composable_scenario: scenario005-multinode.yaml
network_isolation: false

View File

@ -33,5 +33,5 @@ Role Variables
docker images used for TripleO deployment
- `docker_image_tag`: <'latest'> -- tag of docker images used for
TripleO deployment
- `deploy_composable_scenario`: <false> -- whether to deploy one of the
composable scenarios
- `composable_scenario`: <''> -- path to the composable scenarios used at deployment time
- `upgrade_composable_scenario`: <''> -- path to the composable scenarios used at upgrade time

View File

@ -21,4 +21,5 @@ timestamper_cmd: >-
# enable_libvirt_tripleo_ui is a switch to force the steps to run with or
# without virtbmc
enable_libvirt_tripleo_ui: false
deploy_composable_scenario: false
composable_scenario: ""
upgrade_composable_scenario: ""

View File

@ -10,7 +10,6 @@ failed_deployment_list: "{{ working_dir }}/failed_deployment_list.log"
validate_script: overcloud-validate.sh.j2
# Deploy a specific scenario THT to the Overcloud
deploy_composable_scenario: false
composable_scenario: ""
# `floating_ip_cidr` controls the address range used in the network
@ -104,9 +103,9 @@ deploy_args: >-
{{ timeout_args }}
{{ cloud_name_args }}
{{ multinode_args }}
{{ scenario_args }}
{{ pacemaker_args }}
{{ container_args }}
{{ scenario_args }}
{{ network_args }}
{{ resource_registry_nic_configs_args }}
{{ workers_args }}

View File

@ -213,7 +213,7 @@
set_fact:
scenario_args: >-
-e {{ overcloud_templates_path }}/ci/environments/{{ composable_scenario }}
when: deploy_composable_scenario|bool
when: not composable_scenario|trim == ''
- name: set swap_args to enable swap file
set_fact:

View File

@ -29,7 +29,7 @@ git fetch {{ overcloud_templates_repo }} {{ overcloud_templates_refspec }} && gi
popd
{% endif %}
{% if deploy_composable_scenario|bool %}
{% if not composable_scenario|trim == '' %}
## * If desired composable scenario isn't present in the checked-out
## code, but is present in RPM, copy the scenario from RPM location.
## ::
@ -39,6 +39,13 @@ if [ ! -e "{{ overcloud_templates_path }}/ci/environments/{{ composable_scenario
"{{ overcloud_templates_path }}/ci/environments/{{ composable_scenario }}"
fi
{% endif %}
{% if not upgrade_composable_scenario|trim == '' %}
if [ ! -e "{{ overcloud_templates_path }}/ci/environments/{{ upgrade_composable_scenario }}" \
-a -e "/usr/share/openstack-tripleo-heat-templates/ci/environments/{{ upgrade_composable_scenario }}" ]; then
cp "/usr/share/openstack-tripleo-heat-templates/ci/environments/{{ upgrade_composable_scenario }}" \
"{{ overcloud_templates_path }}/ci/environments/{{ upgrade_composable_scenario }}"
fi
{% endif %}
{% endif %}

View File

@ -5,7 +5,7 @@
prepare_service_env_args: >-
-e {{ overcloud_templates_path }}/environments/docker.yaml
-e {{ overcloud_templates_path }}/ci/environments/{{ composable_scenario }}
when: deploy_composable_scenario|bool
when: not composable_scenario|trim == ''
- name: Create overcloud prep-containers script
template:

View File

@ -45,6 +45,7 @@ undercloud_upgrade_user: stack
# - virtual
# - baremetal
deployment_type: virtual
scenario_args: ""
# override those lists with your templates that your env needs for upgrade
# example:
# upgrade_custom_templates_script_delivery:

View File

@ -18,6 +18,12 @@
set_fact:
tht_dir: "/usr/share/openstack-tripleo-heat-templates"
- name: set the scenario args for composable roles
set_fact:
scenario_args: >-
-e {{ tht_dir }}/ci/environments/{{ upgrade_composable_scenario }}
when: not upgrade_composable_scenario|trim == ''
- name: Create major overcloud upgrade script
when: major_upgrade|bool
template:

View File

@ -16,20 +16,22 @@ source {{ upgrade_working_dir }}/stackrc
# pull latest containers to the registry
openstack overcloud container image prepare \
--images-file {{ upgrade_working_dir }}/overcloud_upgrade_containers.yaml \
-e {{ tht_dir }}/environments/docker.yaml \
{{ scenario_args }} \
{% for item in upgrade_custom_templates %}
-e {{ item }} \
{% endfor %}
-e {{ tht_dir }}/environments/docker.yaml \
--namespace {{ docker_registry_host }}/{{ docker_registry_namespace }} \
--tag {{ docker_image_tag }} \
--push-destination {{ local_docker_registry_host }}:8787
openstack overcloud container image prepare \
--env-file ~/containers-default-parameters.yaml \
-e {{ tht_dir }}/environments/docker.yaml \
{{ scenario_args }} \
{% for item in upgrade_custom_templates %}
-e {{ item }} \
{% endfor %}
-e {{ tht_dir }}/environments/docker.yaml \
--namespace {{ local_docker_registry_host }}:8787/{{ docker_registry_namespace }} \
--tag {{ docker_image_tag }}
@ -44,24 +46,27 @@ echo " DockerInsecureRegistryAddress: {{ local_docker_registry_host }}:8787" >>
echo "execute overcloud upgrade"
openstack overcloud deploy --templates {{ tht_dir }} \
{{ deploy_args_used }} \
-e {{ tht_dir }}/environments/docker.yaml \
{{ scenario_args }} \
-e {{ tht_dir }}/environments/major-upgrade-composable-steps-docker.yaml \
-e ~/containers-default-parameters.yaml \
-e ~/overcloud-repo.yaml \
{% for item in upgrade_custom_templates %}
-e {{ item }} \
{% endfor %}
-e {{ tht_dir }}/environments/docker.yaml
if openstack stack show overcloud | grep "stack_status " | egrep "(CREATE|UPDATE)_COMPLETE"; then
openstack overcloud deploy --templates {{ tht_dir }} \
{{ deploy_args_used }} \
-e {{ tht_dir }}/environments/docker.yaml \
{{ scenario_args }} \
-e {{ tht_dir }}/environments/major-upgrade-converge-docker.yaml \
-e ~/containers-default-parameters.yaml \
{% for item in upgrade_custom_templates %}
-e {{ item }} \
{% endfor %}
-e {{ tht_dir }}/environments/docker.yaml
fi

View File

@ -151,6 +151,7 @@ if openstack stack show -c stack_status overcloud -f value | egrep "(CREATE|UPD
{% if enable_pacemaker|bool %}
-e {{ tht_dir }}/environments/puppet-pacemaker.yaml \
{% endif %}
{{ scenario_args }} \
-e {{ tht_dir }}/environments/major-upgrade-composable-steps.yaml \
{% for item in upgrade_custom_templates_script_delivery %}
-e {{ item }} \