--- # Copyright 2019 Red Hat, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. - name: Config Download Export connection: "{{ (tripleo_target_host is defined) | ternary('ssh', 'local') }}" hosts: "{{ tripleo_target_host | default('localhost') }}" remote_user: "{{ tripleo_target_user | default(lookup('env', 'USER')) }}" gather_facts: "{{ (tripleo_target_host is defined) | ternary(true, false) }}" any_errors_fatal: true vars: plan: overcloud config_type: null preserve_config: true pre_tasks: - name: Set config_dir set_fact: config_dir: "{{ lookup('env', 'HOME') ~ '/tripleo-config' }}" when: config_dir is not defined - name: Set config_container set_fact: config_container: "{{ plan ~ '-config' }}" - name: set work_dir set_fact: work_dir: "{{ config_dir ~ '/' ~ plan }}" tasks: - 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: Get config tripleo_config_download: plan: "{{ plan }}" config_container: "{{ config_container }}" config_type: "{{ config_type }}" download: false - name: Get temp url for archive tripleo_swift_tempurl: container: "{{ config_container }}" object: "{{ config_container ~ '.tar.gz' }}" method: GET register: config_download_url - name: Extract config download unarchive: src: "{{ config_download_url.tempurl }}" dest: "{{ work_dir }}" remote_src: true