forked from redhat-cop/agnosticd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
include_vars.yml
29 lines (27 loc) · 828 Bytes
/
include_vars.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
---
- hosts:
- localhost
- all
connection: local
gather_facts: no
tags: include_vars
tasks:
- name: Set output_dir for all hosts
set_fact:
output_dir: "{{ hostvars.localhost.output_dir }}"
when: hostvars.localhost.output_dir is defined
- name: stats env_vars.yml and (legacy) env_secret_vars.yml
stat:
path: "{{ item }}"
loop:
- configs/{{ env_type }}/env_vars.yml
- configs/{{ env_type }}/env_secret_vars.yml
- "{{ secret_file | d('/secret/file/not/passed') }}"
register: rstat_varfiles
- name: Include vars files
include_vars:
file: "{{ item.stat.path }}"
when: item.stat.exists
loop: "{{ rstat_varfiles.results }}"
loop_control:
label: "{{ item._ansible_item_label | default(item) }}"