hcp-ansible/playbooks/load_vars.yml

34 lines
983 B
YAML
Raw Normal View History

---
# hashistack variable injection playbook
- name: "Deploy"
hosts: all
gather_facts: true
become: true
tasks:
- name: "Load global variables"
block:
- name: "Stat global configuration file"
ansible.builtin.stat:
path: "{{ configuration_directory }}/{{ configuration_global_vars_file }}"
register: _global_config_file
- name: "Make sure global configuration file exists"
ansible.builtin.assert:
that:
- _global_config_file.stat.exists
- name: "Load global variables"
ansible.builtin.include_vars:
dir: "{{ configuration_directory }}"
files_matching: "{{ configuration_global_vars_file }}"
- name: "Load group specific variables"
ansible.builtin.include_vars:
dir: ""
files_matching: ""
- name: "Load host specific variables"
ansible.builtin.include_vars:
dir: ""
files_matching: ""