-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
51 lines (38 loc) · 1.16 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
.SILENT:
.DEFAULT_GOAL := all
ROLES := dns dhcp lb bt stork_agent
ANSIBLE_HOST_KEY_CHECKING := "False"
export ANSIBLE_HOST_KEY_CHECKING
.PHONY: all
all: notag
.PHONY: notag
notag: .venv/lock
. .venv/bin/activate && \
python3 -m ansible playbook -i inventory/hosts.yml --become --become-user=root site.yml
.PHONY: install
install: .git/hooks/pre-commit
.PHONY: verbose
verbose: .venv/lock
. .venv/bin/activate && \
python3 -m ansible playbook -i inventory/hosts.yml --become --become-user=root site.yml -vvv
.PHONY: $(ROLES)
$(ROLES): .venv/lock
. .venv/bin/activate && \
python3 -m ansible playbook -i inventory/hosts.yml --become --become-user=root site.yml --tags "$@"
.PHONY: lint
lint: .venv/lock .git/hooks/pre-commit
. ./.venv/bin/activate && \
python3 -m ansiblelint --force-color
.PHONY: clean
clean:
(. .venv/bin/activate && pre-commit uninstall) || true
rm -rf .venv/
.venv/lock: requirements.txt
python3 -m venv .venv/
. .venv/bin/activate && \
python3 -m pip install -U -r requirements.txt
touch .venv/lock
.git/hooks/pre-commit: .pre-commit-config.yaml .venv/lock
. .venv/bin/activate && \
pre-commit install && \
touch .git/hooks/pre-commit