-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
54 lines (39 loc) · 1.44 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
terraform-deploy:
pip3 install --quiet --upgrade pip
pip3 install --quiet --upgrade --requirement requirements.txt
terraform -chdir=tf/ init
terraform -chdir=tf/ validate
# Terraform create instances first
terraform -chdir=tf/ plan -out="tfplan" -var-file="../secrets/credentials.tfvars" -var-file="../secrets/config.tfvars" \
-target="module.digitalocean" \
-target="module.onpremise" \
-target="module.oraclecloud" \
-target="module.transip" \
-target="module.vultr"
terraform -chdir=tf/ apply tfplan
# Terraform finish
terraform -chdir=tf/ plan -out="tfplan" -var-file="../secrets/credentials.tfvars" -var-file="../secrets/config.tfvars"
terraform -chdir=tf/ apply tfplan
terraform-destroy:
terraform -chdir=tf/ init
terraform -chdir=tf/ destroy -auto-approve -var-file="../secrets/credentials.tfvars" -var-file="../secrets/config.tfvars"
terraform-clean:
rm -Rf tf/.terraform
rm -f tf/terraform.tfstate
rm -f tf/terraform.tfstate.backup
rm -f tf/.terraform.lock.hcl
rm -f tf/tfplan
terraform: terraform-deploy
ansible-deploy:
ansible-playbook playbook-deploy.yml
ansible-destroy:
ansible-playbook playbook-destroy.yml
ansible: ansible-deploy
deploy: terraform-deploy ansible-deploy
backup:
pip3 install --quiet --upgrade pip
pip3 install --quiet --upgrade --requirement requirements.txt
ansible-playbook playbook-backup.yml
destroy: ansible-destroy terraform-destroy
clean: terraform-clean
full-redeploy: destroy clean deploy