-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathansible.mk
36 lines (25 loc) · 1.03 KB
/
ansible.mk
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
# vim:ft=make
ROLEBOOKS=
PLAYBOOKS=
ANSIBLE:= $(PIP_BIN_DIR)/ansible
ANSIBLE_PLAYBOOK:= $(PIP_BIN_DIR)/ansible-playbook
ANSIBLE_CHECK:= $(ANSIBLE_PLAYBOOK) --syntax-check
ANSIBLE_PIP_REQUIREMENTS:= aux/ansible/pip.txt
$(ANSIBLE_PIP_REQUIREMENTS):
$(MKDIR_P) $(@D)
$(CURL) -o $@ https://gist.githubusercontent.com/BrianAker/e58417dac282131d2e2a/raw/a62020cbebae51244c128d680724d4b5e7f2b795/ansible-requirements
PREREQ+= $(ANSIBLE)
$(ANSIBLE): $(PIP) $(ANSIBLE_PIP_REQUIREMENTS)
$(if $(wildcard $(ANSIBLE)), $(call pip_install_r,$(ANSIBLE_PIP_REQUIREMENTS)), $(call pip_upgrade_r,$(ANSIBLE_PIP_REQUIREMENTS)))
@$(TOUCH_R) $< $(ANSIBLE_PIP_REQUIREMENTS)
MAINTAINERCLEAN+= .ansible
CHECK+= check-playbook
CHECK+= check-rolebooks
.PHONY: check-playbook
check-playbook: $(PLAYBOOKS)
$(foreach playbook,$(PLAYBOOKS),$(ANSIBLE_CHECK) $(playbook);)
.PHONY: check-rolebooks
check-rolebooks: $(ROLEBOOKS)
$(foreach rolebook,$(ROLEBOOKS),$(ANSIBLE_CHECK) $(rolebook);)
# Required for my ansible setups
SSH_IMPORT_ID:= $(PIP_BIN_DIR)/ssh-import-id