hcp-ansible/playbooks/deploy.yml
Bertrand Lanson 41c6064d01
All checks were successful
development / Check commit compliance (push) Successful in 29s
feat(playbooks): use newly created hashistack role to load and merge variables
2024-07-25 22:29:19 +02:00

56 lines
1.3 KiB
YAML

---
# hashistack deployment playbook
- name: "Deploy"
hosts: "{{ target | default('all, !deployment') }}"
strategy: linear
gather_facts: true
any_errors_fatal: true
become: true
tasks:
- name: "Import variables"
ansible.builtin.import_role:
name: ednz_cloud.hashistack.hashistack
tags:
- always
# Consul nodes deployment
- name: "Deploy Consul"
tags:
- consul
when:
- enable_consul | bool
ansible.builtin.import_tasks:
file: tasks/consul/consul_deploy.yml
# Vault nodes deployment
- name: "Deploy Vault"
tags:
- vault
when:
- enable_vault | bool
ansible.builtin.import_tasks:
file: tasks/vault/vault_deploy.yml
# Nomad nodes deployment
- name: "Deploy Nomad"
tags:
- nomad
when:
- enable_nomad | bool
ansible.builtin.import_tasks:
file: tasks/nomad/nomad_deploy.yml
# - fail:
# Haproxy nodes deployment
# - name: "Deploy Proxies"
# tags:
# - haproxy
# when:
# - enable_haproxy | bool
# block:
# - name: "Deploy Haproxy & Keepalived"
# ansible.builtin.import_tasks:
# file: tasks/haproxy/haproxy_deploy.yml
# when:
# - "'haproxy_servers' in group_names"