Guillaume Coré
2019-12-09 dafba27ba5da1314c65cef2ee05867e968f345d8
commit | author | age
192691 1 ---
GC 2 - hosts:
3     - localhost
ae6f44 4     - all
192691 5   connection: local
GC 6   gather_facts: no
ba0c61 7   tags: include_vars
192691 8   tasks:
ae6f44 9     - name: Set output_dir for all hosts
GC 10       set_fact:
11         output_dir: "{{ hostvars.localhost.output_dir }}"
12       when: hostvars.localhost.output_dir is defined
13
192691 14     - name: stats env_vars.yml and (legacy) env_secret_vars.yml
GC 15       stat:
ef0bab 16         path: "{{ item }}"
192691 17       loop:
ef0bab 18         - configs/{{ env_type }}/env_vars.yml
d84223 19         - cloud_providers/{{ cloud_provider }}_default_vars.yml
ef0bab 20         - configs/{{ env_type }}/env_secret_vars.yml
PS 21         - "{{ secret_file | d('/secret/file/not/passed') }}"
192691 22       register: rstat_varfiles
GC 23
24     - name: Include vars files
25       include_vars:
26         file: "{{ item.stat.path }}"
dafba2 27       when:
GC 28         - item is not skipped
29         - item.stat.exists
192691 30       loop: "{{ rstat_varfiles.results }}"
GC 31       loop_control:
dafba2 32         label: >-
GC 33           {{ (
34             item.stat.path
35             | default(item._ansible_item_label)
36             | default(item)
37           ) if 'stat' in item else item }}