-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
28 lines (20 loc) · 785 Bytes
/
Makefile
File metadata and controls
28 lines (20 loc) · 785 Bytes
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
ENVIRONMENT:=local
ENV_LIST:=local jcu qa production
HOSTS=
# make each envrionment a target which sets
# the ENVIRONMENT variable
$(ENV_LIST):
$(eval ENVIRONMENT:=$@)
# make host targets to limit the applicable hosts
standalone:
$(eval HOSTS=standalone)
echo:
$(info using envrionment $(ENVIRONMENT))
# run ansible
#
# the patsubst will only add a -l option if any hosts have been declared. Otherwise Ansible will run the play for every host declared in the inventory.
deploy:
ansible-playbook playbook.yml -i inventory/$(ENVIRONMENT) --ask-vault-pass $(patsubst %,-l %,$(HOSTS)) $(EXTRA)
reindex:
ansible-playbook reindex-everything.yml -i inventory/$(ENVIRONMENT) --ask-vault-pass $(patsubst %,-l %,$(HOSTS)) $(EXTRA)
.PHONY: $(ENV_LIST) standalone echo deploy reindex