--- # # Copyright (c) 2019 Wind River Systems, Inc. # # SPDX-License-Identifier: Apache-2.0 # - hosts: all # If gathering facts is really necessary, run setup task AFTER host connectivity # check block in common role. gather_facts: no vars_files: - host_vars/default.yml pre_tasks: - stat: path: "{{ item }}" register: files_to_import with_items: - "{{ override_files_dir }}/secrets.yml" - "{{ override_files_dir }}/{{ inventory_hostname }}_secrets.yml" - "{{ override_files_dir }}/site.yml" - "{{ override_files_dir }}/{{ inventory_hostname }}.yml" delegate_to: localhost - include_vars: "{{ item.item }}" when: item.stat.exists with_items: "{{ files_to_import.results }}" loop_control: label: "{{ item.item }}" # Main play roles: - common - { role: restore-openstack/restore, become: yes }