From 162f567c85d511226122bdd6b7231647a1e9c8f2 Mon Sep 17 00:00:00 2001 From: Ian Fijolek Date: Fri, 18 Nov 2022 08:58:20 -0800 Subject: [PATCH] Stop Nomad and Vault when recovering Consul --- ansible_playbooks/recover-consul.yaml | 40 +++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/ansible_playbooks/recover-consul.yaml b/ansible_playbooks/recover-consul.yaml index 67328b8..0c6b9d5 100644 --- a/ansible_playbooks/recover-consul.yaml +++ b/ansible_playbooks/recover-consul.yaml @@ -1,4 +1,24 @@ --- +- name: Stop Nomad + hosts: nomad_instances + + tasks: + - name: Stop Nomad + systemd: + name: nomad + state: stopped + become: true + +- name: Stop Vault + hosts: nomad_instances + + tasks: + - name: Stop Vault + systemd: + name: vault + state: stopped + become: true + - name: Recover Consul hosts: consul_instances @@ -42,3 +62,23 @@ name: consul state: restarted become: true + +- name: Start Vault + hosts: nomad_instances + + tasks: + - name: Start Vault + systemd: + name: vault + state: started + become: true + +- name: Start Nomad + hosts: nomad_instances + + tasks: + - name: Start Nomad + systemd: + name: nomad + state: started + become: true