tripleo-upgrade/tasks/common/replace_environment_file.yaml
Luigi Toscano 4458ab622a [ffwd] Allow users to replace environment files
A new option allows user to replace the content of specific
environment files which are listed in the "overcloud deploy"
bash script which is parsed and used here.

This is useful when the content of a file is known to
have changed between the source and destination release.
The feature is implemented for FFWD only right now,
but it could be used for any kind of upgrade/update process.

Change-Id: I027770e0ac8c73896d2b57218da3a5063b9707fd
2021-04-29 14:19:49 +02:00

20 lines
666 B
YAML

---
- name: determine the name of the replaced environment file
shell:
cat {{ overcloud_deploy_script }} | grep '-e .\+{{ item.key }} ' | sed 's/.\+ \(.\+{{ item.key }}\) .*/\1/'
register: ffu_replaced_env_file
- block:
- name: save a copy of the replaced environment configuration file
copy:
remote_src: true
src: "{{ ffu_replaced_env_file.stdout }}"
dest: "{{ ffu_replaced_env_file.stdout }}.orig.yaml"
- name: replace the environment configuration file with the new one
copy:
src: "{{ item.value }}"
dest: "{{ ffu_replaced_env_file.stdout }}"
when: ffu_replaced_env_file.stdout|length > 0