Make target to stop Nomad cluster
This commit is contained in:
parent
8d63c50ffb
commit
33ec66346b
20
Makefile
20
Makefile
@ -59,24 +59,18 @@ ansible-cluster: $(VENV) ansible_galaxy
|
|||||||
./ansible_playbooks/setup-cluster.yml
|
./ansible_playbooks/setup-cluster.yml
|
||||||
|
|
||||||
.PHONY: bootstrap-values
|
.PHONY: bootstrap-values
|
||||||
bootstrap-values: $(VENV) ansible_galaxy
|
bootstrap-values: $(VENV)
|
||||||
env VIRTUAL_ENV=$(VENV) $(VENV)/bin/ansible-playbook -vv \
|
env NOMAD_ADDR=192.168.2.101 \
|
||||||
-e "@vault-keys.json" \
|
NOMAD_TOKEN=$(shell jq -r .SecretID nomad_bootstrap.json) \
|
||||||
./ansible_playbooks/bootstrap-values.yml
|
$(VENV)/bin/python ./nomad_vars.py
|
||||||
|
|
||||||
.PHONY: recover-consul
|
|
||||||
recover-consul: $(VENV)
|
|
||||||
$(VENV)/bin/ansible-playbook -K ./ansible_playbooks/recover-consul.yaml
|
|
||||||
|
|
||||||
.PHONY: recover-nomad
|
.PHONY: recover-nomad
|
||||||
recover-nomad: $(VENV)
|
recover-nomad: $(VENV)
|
||||||
$(VENV)/bin/ansible-playbook -K ./ansible_playbooks/recover-nomad.yaml
|
$(VENV)/bin/ansible-playbook -K ./ansible_playbooks/recover-nomad.yaml
|
||||||
|
|
||||||
.PHONY: unseal-vault
|
.PHONY: stop-cluster
|
||||||
unseal-vault: $(VENV)
|
stop-cluster: $(VENV)
|
||||||
env VIRTUAL_ENV=$(VENV) $(VENV)/bin/ansible-playbook -vv \
|
$(VENV)/bin/ansible-playbook -K ./ansible_playbooks/stop-cluster.yml
|
||||||
-e "@vault-keys.json" \
|
|
||||||
./ansible_playbooks/unseal-vault.yml
|
|
||||||
|
|
||||||
.PHONY: init
|
.PHONY: init
|
||||||
init:
|
init:
|
||||||
|
@ -8,23 +8,3 @@
|
|||||||
name: nomad
|
name: nomad
|
||||||
state: stopped
|
state: stopped
|
||||||
become: true
|
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
|
|
||||||
|
Loading…
Reference in New Issue
Block a user