From 8b65d49b74bc441eeaa5fbd6ce8586bd73aab715 Mon Sep 17 00:00:00 2001 From: James Slagle Date: Wed, 31 Mar 2021 07:25:56 -0400 Subject: [PATCH] Collect and output outputs/passwords files with old and new locations In Idded7faba1ff6c811b94503c559029aeeaca6a06, we are changing the default path for tripleo-undercloud-outputs.yaml and tripleo-undercloud-passwords.yaml. These tasks in CI that expect the files to exist at the old location are updated to use the first_found lookup to check both the old and new paths. Likewise, when the output files are written on the minion, they are written to both the old and new locations until the tripleoclient patch merges. Once the tripleoclient patch merges, we can update these tasks to only look at the new path. Partial-Bug: #1921975 Signed-off-by: James Slagle Change-Id: If28d5b225439162b7983165fe3bea605971cfb74 --- playbooks/multinode-undercloud-minion.yml | 12 +++++++++++- roles/undercloud-deploy/tasks/gather-outputs.yml | 12 ++++++++++-- roles/undercloud-setup/defaults/main.yml | 2 ++ roles/undercloud-setup/tasks/write-outputs.yml | 4 ++-- 4 files changed, 25 insertions(+), 5 deletions(-) diff --git a/playbooks/multinode-undercloud-minion.yml b/playbooks/multinode-undercloud-minion.yml index d1df23e1e..145fb7578 100644 --- a/playbooks/multinode-undercloud-minion.yml +++ b/playbooks/multinode-undercloud-minion.yml @@ -19,10 +19,20 @@ set_fact: undercloud_outputs: "{{ hostvars['undercloud']['undercloud_outputs'] }}" undercloud_passwords: "{{ hostvars['undercloud']['undercloud_passwords'] }}" - - name: write output files + - name: write output files to old consistent location include_role: name: undercloud-setup tasks_from: write-outputs + - name: create new consistent location + file: + state: directory + path: "{{ working_dir ~ '/tripleo-deploy/minion' }}" + - name: write output files to new consistent location + include_role: + name: undercloud-setup + tasks_from: write-outputs + vars: + undercloud_outputs_dir: "{{ working_dir ~ '/tripleo-deploy/minion/' }}" tags: - undercloud-setup diff --git a/roles/undercloud-deploy/tasks/gather-outputs.yml b/roles/undercloud-deploy/tasks/gather-outputs.yml index d42c10de7..0cb94159e 100644 --- a/roles/undercloud-deploy/tasks/gather-outputs.yml +++ b/roles/undercloud-deploy/tasks/gather-outputs.yml @@ -3,13 +3,21 @@ # their contents - name: Collect undercloud outputs slurp: - src: "{{ working_dir }}/tripleo-undercloud-outputs.yaml" + src: "{{ lookup('first_found', output_paths, errors='ignore') }}" register: tmp_undercloud_outputs + vars: + output_paths: + - "{{ working_dir }}/tripleo-undercloud-outputs.yaml" + - "{{ working_dir }}/tripleo-deploy/undercloud/tripleo-undercloud-outputs.yaml" - name: Collect undercloud passwords slurp: - src: "{{ working_dir }}/tripleo-undercloud-passwords.yaml" + src: "{{ lookup('first_found', password_paths, errors='ignore') }}" register: tmp_undercloud_passwords + vars: + password_paths: + - "{{ working_dir }}/tripleo-undercloud-passwords.yaml" + - "{{ working_dir }}/tripleo-deploy/undercloud/tripleo-undercloud-passwords.yaml" - name: Setting undercloud outputs and password facts set_fact: diff --git a/roles/undercloud-setup/defaults/main.yml b/roles/undercloud-setup/defaults/main.yml index 59e58dd54..48b5388fc 100644 --- a/roles/undercloud-setup/defaults/main.yml +++ b/roles/undercloud-setup/defaults/main.yml @@ -42,3 +42,5 @@ undercloud_ara: false install_atop: true atop_command: atop -R -w /var/log/atop.bin tripleo_set_unique_hostname: false + +undercloud_outputs_dir: "{{ working_dir }}" diff --git a/roles/undercloud-setup/tasks/write-outputs.yml b/roles/undercloud-setup/tasks/write-outputs.yml index b3337bd84..4d9b50ebb 100644 --- a/roles/undercloud-setup/tasks/write-outputs.yml +++ b/roles/undercloud-setup/tasks/write-outputs.yml @@ -3,9 +3,9 @@ - name: Write out tripleo-undercloud-outputs.yaml copy: content: "{{ undercloud_outputs }}" - dest: "{{ working_dir }}/tripleo-undercloud-outputs.yaml" + dest: "{{ undercloud_outputs_dir }}/tripleo-undercloud-outputs.yaml" - name: Write out tripleo-undercloud-passwords.yaml copy: content: "{{ undercloud_passwords }}" - dest: "{{ working_dir }}/tripleo-undercloud-passwords.yaml" + dest: "{{ undercloud_outputs_dir }}/tripleo-undercloud-passwords.yaml"