Convert CLI options to variables for updates/upgrades/ffwd.

Some cli options like --ntp-server/--control-scaler have variables
e.g.: NtpServer or RoleFlavor/Count.
It makes sense to convert them to env file and use it in follow up
 update/upgrade/ffwd operations, rather then maintain a list of cli
options.

Change-Id: Ie1305b8783de403fe0c725b1207782dd8336c053
This commit is contained in:
Yurii Prokulevych 2018-05-09 16:49:52 +02:00
parent 26a7d90555
commit c60e7a964c
7 changed files with 27 additions and 4 deletions

View File

@ -96,3 +96,13 @@
force: no
when:
- control_scale|succeeded or compute_scale|succeeded or ceph_scale|succeeded or control_flavor|succeeded or compute_flavor|succeeded or ceph_flavor|succeeded or ntp_server|succeeded
- name: check "{{working_dir}}/cli_opts_params.yaml" exists
stat:
path: "{{working_dir}}/cli_opts_params.yaml"
register: cli_opts_param_file
- name: set cli_converted_options fact
set_fact:
cli_converted_options: true
when: cli_opts_param_file.stat.exists|bool

View File

@ -42,12 +42,12 @@
- name: set upgrade_prepare_extra_params for ffu prepare with default repos
set_fact:
upgrade_prepare_extra_params: ["{{working_dir}}/cli_opts_params.yaml", "{{ tht_directory }}/environments/docker.yaml", "{{ tht_directory }}/environments/docker-ha.yaml"]
upgrade_prepare_extra_params: ["{{ tht_directory }}/environments/docker.yaml", "{{ tht_directory }}/environments/docker-ha.yaml"]
when: "'tripleo-repos' in ffu_overcloud_repo_type"
- name: set upgrade_prepare_extra_params for ffu prepare with custom repos
set_fact:
upgrade_prepare_extra_params: ["{{working_dir}}/cli_opts_params.yaml", "{{working_dir}}/ffu_repos.yaml"]
upgrade_prepare_extra_params: ["{{working_dir}}/ffu_repos.yaml"]
when: "'tripleo-repos' not in ffu_overcloud_repo_type"
- name: set upgrade_prepare_extra_params for ffu prepare with deployed server

View File

@ -4,6 +4,9 @@
tags: use_oooq
when: use_oooq|bool
- name: Convert CLI options to parameters
include: ../common/convert_cli_opts_params.yaml
- name: get auxiliary facts for major upgrades
include: ../common/auxilary-facts.yaml

View File

@ -4,6 +4,9 @@
tags: use_oooq
when: use_oooq|bool
- name: Convert CLI options to parameters
include: ../common/convert_cli_opts_params.yaml
- name: get auxiliary facts for major upgrades
include: ../common/auxilary-facts.yaml

View File

@ -12,8 +12,10 @@ openstack overcloud ceph-upgrade run \
-e {{ _env }} \
{% endfor %}
{% endif %}
{% if ffu_overcloud_upgrade %}
{% if cli_converted_options|default(false)|bool %}
-e {{working_dir}}/cli_opts_params.yaml \
{% endif %}
{% if ffu_overcloud_upgrade %}
-e {{working_dir}}/ceph-ansible-env.yaml \
--ceph-ansible-playbook '/usr/share/ceph-ansible/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml,/usr/share/ceph-ansible/infrastructure-playbooks/rolling_update.yml' \
{% endif %}

View File

@ -26,8 +26,10 @@ openstack overcloud {% if ffu_overcloud_upgrade %} ffwd-upgrade {% else %} upgra
-e {{ _env }} \
{% endfor %}
{% endif %}
{% if ffu_overcloud_upgrade %}
{% if cli_converted_options|default(false)|bool %}
-e {{working_dir}}/cli_opts_params.yaml \
{% endif %}
{% if ffu_overcloud_upgrade %}
-e {{ working_dir }}/{{ container_registry_file }} \
{% if ceph_osd_enabled %}
-e {{working_dir}}/ceph-ansible-env.yaml \

View File

@ -27,6 +27,9 @@ openstack overcloud{% if ffu_overcloud_upgrade %} ffwd-upgrade {% else %} upgrad
-e {{ _env }} \
{% endfor %}
{% endif %}
{% if cli_converted_options|default(false)|bool %}
-e {{working_dir}}/cli_opts_params.yaml \
{% endif %}
{% if upgrade_prepare_extra_params %}
-e {{ upgrade_prepare_extra_params | join(' -e ') }} \
{% endif %}