forked from redhat-cop/agnosticd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
include_vars.yml
51 lines (48 loc) · 1.58 KB
/
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
---
- name: Step 0000 Include Vars
hosts:
- localhost
- all
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: Include variables files
vars:
__vars_file_base:
# Global default vars related to the cloud provider
- cloud_providers/{{ cloud_provider }}_default_vars
# Legacy env_vars.yml (replaced by default_vars.yml)
- configs/{{ env_type }}/env_vars
# Default vars of the config
- configs/{{ env_type }}/default_vars
# Default vars of the config, specific to a cloud provider
- configs/{{ env_type }}/default_vars_{{ cloud_provider }}
# Lecacy secret vars file.
- configs/{{ env_type }}/env_secret_vars
__vars_file_extension:
- yaml
- yml
__vars_file: "{{ playbook_dir }}/{{ __vars_file_parts[0] }}.{{ __vars_file_parts[1] }}"
loop: "{{ __vars_file_base | product(__vars_file_extension) | list }}"
loop_control:
loop_var: __vars_file_parts
label: "{{ __vars_file }}"
when:
- __vars_file is file
include_vars:
file: "{{ __vars_file }}"
- name: Include secret_file if passed as extra-var
when: secret_file is defined
include_vars:
file: "{{ secret_file }}"
- name: Set passthrough user data
when:
- agnosticd_passthrough_user_data is defined
- agnosticd_passthrough_user_data | length > 0
agnosticd_user_info:
data: "{{ agnosticd_passthrough_user_data }}"
run_once: true