-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
54 lines (39 loc) · 1.14 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
account := personal-terraform
# Ansible commands
.PHONY: setup
setup:
ansible-playbook -i ansible/inventory.yaml ansible/setup.yaml
.PHONY: restart
restart:
ansible-playbook -i ansible/inventory.yaml ansible/restart.yaml
.PHONY: update
update:
ansible-playbook -i ansible/inventory.yaml ansible/update.yaml
.PHONY: backup
backup:
ansible-playbook -i ansible/inventory.yaml ansible/backup.yaml
.PHONY: restore
restore:
ansible-playbook -i ansible/inventory.yaml ansible/restore.yaml
.PHONY: ping # ping all hosts
ping:
ansible all -m ping -i ansible/inventory.yaml
.PHONY: ssh # ssh as ansible
ssh:
ssh -i ~/.ssh/id_ed25519 ansible-ssh@ubuntu-rpi
# Terraform commands
.PHONY: identity
identity:
aws-vault exec $(account) -- aws sts get-caller-identity
.PHONY: init
init:
aws-vault exec $(account) -- terraform -chdir=infrastructure init -backend-config=secrets.tfvars
.PHONY: plan
plan:
aws-vault exec $(account) -- terraform -chdir=infrastructure plan
.PHONY: apply
apply:
aws-vault exec $(account) -- terraform -chdir=infrastructure apply
.PHONY: destroy
destroy:
aws-vault exec $(account) -- terraform -chdir=infrastructure destroy