hcp-ansible/playbooks/tasks/load_vars.yml
Bertrand Lanson 95a1d80f76
All checks were successful
development / Check commit compliance (push) Successful in 26s
feat: add nomad deployment options, variables, and playbooks
2024-06-25 15:16:42 +02:00

55 lines
1.4 KiB
YAML

---
# hashistack variable injection playbook
- name: "Load global variables"
ansible.builtin.import_tasks:
file: misc/load_global_vars.yml
- name: "Load credentials variables"
ansible.builtin.import_tasks:
file: misc/load_credentials_vars.yml
- name: "Load group specific variables"
ansible.builtin.import_tasks:
file: misc/load_group_vars.yml
- name: "Load host specific variables"
ansible.builtin.import_tasks:
file: misc/load_host_vars.yml
- name: "Ensure remote directories exists"
ansible.builtin.file:
path: "{{ item }}"
state: directory
owner: root
group: root
mode: 0755
recurse: yes
loop:
- "{{ hashistack_remote_config_dir }}"
- "{{ hashistack_remote_data_dir }}"
- name: "Load custom CA certificates"
ansible.builtin.import_tasks:
file: misc/load_ca_certificates.yml
- name: "Merge consul configurations"
ansible.builtin.import_tasks:
file: "consul/consul_vars.yml"
when:
- enable_consul | bool
- "('consul_servers' in group_names) or ('consul_agents' in group_names)"
- name: "Merge vault configurations"
ansible.builtin.import_tasks:
file: "vault/vault_vars.yml"
when:
- enable_vault | bool
- "'vault_servers' in group_names"
- name: "Merge nomad configurations"
ansible.builtin.import_tasks:
file: "nomad/nomad_vars.yml"
when:
- enable_nomad | bool
- "('nomad_servers' in group_names) or ('nomad_clients' in group_names)"