Make target to stop Nomad cluster

This commit is contained in:
IamTheFij 2023-05-09 11:39:27 -07:00
parent 8d63c50ffb
commit 33ec66346b
2 changed files with 7 additions and 33 deletions

View File

@ -59,24 +59,18 @@ ansible-cluster: $(VENV) ansible_galaxy
./ansible_playbooks/setup-cluster.yml
.PHONY: bootstrap-values
bootstrap-values: $(VENV) ansible_galaxy
env VIRTUAL_ENV=$(VENV) $(VENV)/bin/ansible-playbook -vv \
-e "@vault-keys.json" \
./ansible_playbooks/bootstrap-values.yml
.PHONY: recover-consul
recover-consul: $(VENV)
$(VENV)/bin/ansible-playbook -K ./ansible_playbooks/recover-consul.yaml
bootstrap-values: $(VENV)
env NOMAD_ADDR=192.168.2.101 \
NOMAD_TOKEN=$(shell jq -r .SecretID nomad_bootstrap.json) \
$(VENV)/bin/python ./nomad_vars.py
.PHONY: recover-nomad
recover-nomad: $(VENV)
$(VENV)/bin/ansible-playbook -K ./ansible_playbooks/recover-nomad.yaml
.PHONY: unseal-vault
unseal-vault: $(VENV)
env VIRTUAL_ENV=$(VENV) $(VENV)/bin/ansible-playbook -vv \
-e "@vault-keys.json" \
./ansible_playbooks/unseal-vault.yml
.PHONY: stop-cluster
stop-cluster: $(VENV)
$(VENV)/bin/ansible-playbook -K ./ansible_playbooks/stop-cluster.yml
.PHONY: init
init:

View File

@ -8,23 +8,3 @@
name: nomad
state: stopped
become: true
- name: Stop Vault
hosts: nomad_instances
tasks:
- name: Stop Vault
systemd:
name: vault
state: stopped
become: true
- name: Stop Consul
hosts: consul_instances
tasks:
- name: Stop Consul
systemd:
name: consul
state: stopped
become: true