From 42cc78dd62a0a93f877039893a2137f0a1172216 Mon Sep 17 00:00:00 2001 From: James Slagle Date: Wed, 4 Aug 2021 17:13:20 -0400 Subject: [PATCH] Align tasks between config-download playbooks cli-config-download.yaml and cli-config-download-export.yaml both download the config from the stack. This commit aligns the tasks between the 2 so that they both setup and download the config in the same way. This allows a single playbook to be used by tripleoclient (cli-config-download.yaml) as done in Ia765c2c2ea548a1dcd20f592eda8741f40a1cf16 cli-config-download-export.yaml will be removed in a subsequent patch as it will no longer be used by tripleoclient. Change-Id: Ie47abe2d7c5d7891aceb88d9008d45d7922dea15 Signed-off-by: James Slagle (cherry picked from commit b6f1bfc408ea37dab1cae261b092172058c830dc) --- tripleo_ansible/playbooks/cli-config-download.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tripleo_ansible/playbooks/cli-config-download.yaml b/tripleo_ansible/playbooks/cli-config-download.yaml index 0029a1882..fd4c93e44 100644 --- a/tripleo_ansible/playbooks/cli-config-download.yaml +++ b/tripleo_ansible/playbooks/cli-config-download.yaml @@ -26,6 +26,8 @@ ansible_ssh_user: tripleo-admin ansible_ssh_private_key_file: /home/stack/.ssh/id_rsa python_interpreter: null + config_type: null + preserve_config: true tasks: - name: Set output_dir @@ -37,11 +39,23 @@ set_fact: work_dir: "{{ output_dir ~ '/' ~ plan }}" + - name: Clean work_dir + file: + path: "{{ work_dir }}" + state: absent + when: not preserve_config | bool + + - name: Create config dir if does not exist + file: + path: "{{ work_dir }}" + state: directory + - name: Download config tripleo_config_download: plan: "{{ plan }}" work_dir: "{{ work_dir }}" download: true + config_type: "{{ config_type }}" - name: Generate ansible inventory tripleo_generate_ansible_inventory: