From 7c3968536fa17ff154d0f24a8c28c3d9e5fad8ca Mon Sep 17 00:00:00 2001 From: mciecier Date: Mon, 30 May 2022 15:30:22 +0200 Subject: [PATCH] Make config-heat and config-resource options comptatible with OOOQ The original implementation restricted the usage strictly to infrared, see[1]. [1] https://review.opendev.org/c/openstack/tripleo-upgrade/+/709972 Change-Id: I8a985e496aa0161193becb38ad043835c4c21778 --- infrared_plugin/main.yml | 13 +++++++++++++ tasks/common/build_extra_template.yaml | 14 -------------- .../create-overcloud-ffu-scripts.yaml | 3 +-- tasks/update/create-overcloud-update-scripts.yaml | 3 +-- 4 files changed, 15 insertions(+), 18 deletions(-) diff --git a/infrared_plugin/main.yml b/infrared_plugin/main.yml index d0d7ed11..b4a7233a 100644 --- a/infrared_plugin/main.yml +++ b/infrared_plugin/main.yml @@ -261,6 +261,19 @@ enforce_rhel: true when: install.enforce.rhel + - name: Set parameter_defaults for config_heat_extra.yaml + set_fact: + config_heat_extra_yaml: + parameter_defaults: "{{ install.get('config', {}).get('heat', {}) }}" + when: install.get('config', {}).get('heat', {}) + + - name: Set resource_registry for config_heat_extra.yaml + vars: + config_resource: "{{ install.get('config', {}).get('resource', {}) }}" + set_fact: + config_heat_extra_yaml: "{{ config_heat_extra_yaml | default({}) | combine({'resource_registry': config_resource}) }}" + when: install.get('config', {}).get('resource', {}) + - name: Enable the execution of validations set_fact: run_validations: true diff --git a/tasks/common/build_extra_template.yaml b/tasks/common/build_extra_template.yaml index 5c8c1059..bf36de7f 100644 --- a/tasks/common/build_extra_template.yaml +++ b/tasks/common/build_extra_template.yaml @@ -1,19 +1,5 @@ --- -- name: set parameter_defaults for config_heat_extra.yaml - set_fact: - config_heat_extra_yaml: - parameter_defaults: "{{ install.get('config', {}).get('heat', {}) }}" - when: install.get('config', {}).get('heat', {}) - -- name: set resource_registry for config_heat_extra.yaml - vars: - config_resource: "{{ install.get('config', {}).get('resource', {}) }}" - set_fact: - config_heat_extra_yaml: "{{ config_heat_extra_yaml | default({}) | combine({'resource_registry': config_resource}) }}" - when: install.get('config', {}).get('resource', {}) - - name: inject config_heat_extra.yaml copy: dest: "{{ install.deployment.files | basename }}/config_heat_extra.yaml" content: "{{ config_heat_extra_yaml | to_nice_yaml }}" - when: config_heat_extra_yaml is defined diff --git a/tasks/fast-forward-upgrade/create-overcloud-ffu-scripts.yaml b/tasks/fast-forward-upgrade/create-overcloud-ffu-scripts.yaml index 8e0aaa6c..17aa581c 100644 --- a/tasks/fast-forward-upgrade/create-overcloud-ffu-scripts.yaml +++ b/tasks/fast-forward-upgrade/create-overcloud-ffu-scripts.yaml @@ -121,10 +121,9 @@ include_tasks: create-overcloud-ffu-hosts-scripts.yaml with_together: "{{ (oc_roles_hosts|dict2items | default([])) | map(attribute='value') | map('sort') | flatten(1) }}" -# TODO: Not comptatible with oooq - name: build extra templates based on new options. import_tasks: ../common/build_extra_template.yaml - when: not use_oooq|bool + when: config_heat_extra_yaml is defined - name: create overcloud upgrade prepare script vars: diff --git a/tasks/update/create-overcloud-update-scripts.yaml b/tasks/update/create-overcloud-update-scripts.yaml index 2adaf083..f6ed25b3 100644 --- a/tasks/update/create-overcloud-update-scripts.yaml +++ b/tasks/update/create-overcloud-update-scripts.yaml @@ -18,10 +18,9 @@ - name: get auxiliary facts for major upgrades import_tasks: ../common/auxilary-facts.yaml -# TODO: Not comptatible with oooq - name: Build extra templates based on new options. import_tasks: ../common/build_extra_template.yaml - when: not use_oooq|bool + when: config_heat_extra_yaml is defined - name: create undercloud update script template: