From 0c75e145262b2d98b76d65045565ece290273b4e Mon Sep 17 00:00:00 2001 From: jeremy Date: Wed, 4 Feb 2026 10:00:35 -0600 Subject: [PATCH] Add HashiCorp deployment --- playbooks/deploy-hashicorp.yml | 58 ++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 playbooks/deploy-hashicorp.yml diff --git a/playbooks/deploy-hashicorp.yml b/playbooks/deploy-hashicorp.yml new file mode 100644 index 0000000..0cbbdf2 --- /dev/null +++ b/playbooks/deploy-hashicorp.yml @@ -0,0 +1,58 @@ +--- +# Deploy Consul + Nomad cluster +# Run: ansible-playbook -i inventory/hosts.yml playbooks/deploy-hashicorp.yml + +- name: Deploy Consul cluster + hosts: hashicorp + become: yes + roles: + - consul + tags: + - consul + +- name: Deploy Nomad cluster + hosts: hashicorp + become: yes + roles: + - nomad + tags: + - nomad + +- name: Display cluster status + hosts: consul_servers + become: yes + tasks: + - name: Check Consul members + command: consul members + register: consul_members + changed_when: false + + - name: Check Nomad server members + command: nomad server members + register: nomad_members + changed_when: false + + - name: Check Nomad node status + command: nomad node status + register: nomad_nodes + changed_when: false + + - name: Display Consul cluster status + debug: + msg: "{{ consul_members.stdout_lines }}" + + - name: Display Nomad server status + debug: + msg: "{{ nomad_members.stdout_lines }}" + + - name: Display Nomad node status + debug: + msg: "{{ nomad_nodes.stdout_lines }}" + + - name: Display access URLs + debug: + msg: + - "Consul UI: http://{{ ansible_host }}:8500" + - "Nomad UI: http://{{ ansible_host }}:4646" + tags: + - status