2023-04-11 20:24:55 +00:00
|
|
|
I := inventory # inventory file
|
|
|
|
L := "$(shell hostname -s)" # host limit
|
|
|
|
C := -c local # connection
|
|
|
|
K := -K # prompt for sudo password
|
|
|
|
O := # additional options
|
|
|
|
P := site.yml # playbook
|
2023-04-12 06:13:11 +00:00
|
|
|
T := # if y, time the process
|
2023-04-11 20:24:55 +00:00
|
|
|
V := -vvv # verbosity
|
2023-04-11 02:55:24 +00:00
|
|
|
|
2023-04-12 06:13:11 +00:00
|
|
|
|
|
|
|
ifeq ($T,y)
|
|
|
|
TIME = /usr/bin/time -v
|
|
|
|
else
|
|
|
|
TIME =
|
|
|
|
endif
|
|
|
|
|
2023-04-11 02:55:24 +00:00
|
|
|
all: deploy
|
|
|
|
|
2023-04-12 06:13:11 +00:00
|
|
|
print-%: ; @echo '$(subst ','\'',$*=$($*))'
|
|
|
|
|
2023-04-11 02:55:24 +00:00
|
|
|
check:
|
2023-04-12 06:13:11 +00:00
|
|
|
$(TIME) ansible-playbook -i $I -l $L $C $K --syntax-check $V $O $P
|
2023-04-11 02:55:24 +00:00
|
|
|
|
|
|
|
deploy:
|
2023-04-12 06:13:11 +00:00
|
|
|
$(TIME) ansible-playbook -i $I -l $L $C $K $V $O $P
|
2023-04-11 02:55:24 +00:00
|
|
|
|
|
|
|
.PHONY: all check deploy
|