-
Notifications
You must be signed in to change notification settings - Fork 25
/
Makefile
92 lines (86 loc) · 2.59 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#
# Basic usage:
# Run `update.yml` in env `<env>`:
# $ make <env>`
#
# Advanced usage:
# Run `<playbook>.yml` with `--tags=<TAGS>` and `--limit=<LIMIT>` in env `<env>`:
# $ make TAGS=<tag[,tag ...]> LIMIT=<host_or_group[,host_or_group ...]> <env>-<playbook>
ifneq ($(strip $(TAGS)),)
TAGS_ARG = "--tags=$(TAGS)"
endif
ifneq ($(strip $(LIMIT)),)
LIMIT_ARG = "--limit=$(LIMIT)"
endif
PLAYBOOK := update
RESTART_ARG :=
# These targets are automatically generated
main-backup: PLAYBOOK = backup
main-backup: main
main-client: PLAYBOOK = client
main-client: main
main-config: PLAYBOOK = config
main-config: main
main-config-no-restart: PLAYBOOK = config
main-config-no-restart: RESTART_ARG = "-e restart=false"
main-config-no-restart: main
main-pulsar: PLAYBOOK = pulsar
main-pulsar: main
main-restart: PLAYBOOK = restart
main-restart: main
main-snapshot: PLAYBOOK = snapshot
main-snapshot: main
main-stack: PLAYBOOK = stack
main-stack: main
main-static: PLAYBOOK = static
main-static: main
main-update: PLAYBOOK = update
main-update: main
main-update-no-restart: PLAYBOOK = update
main-update-no-restart: RESTART_ARG = "-e restart=false"
main-update-no-restart: main
main-tpv: PLAYBOOK = tpv
main-tpv: main
main-tusd: PLAYBOOK = tusd
main-tusd: main
test-backup: PLAYBOOK = backup
test-backup: test
test-client: PLAYBOOK = client
test-client: test
test-config: PLAYBOOK = config
test-config: test
test-config-no-restart: PLAYBOOK = config
test-config-no-restart: RESTART_ARG = "-e restart=false"
test-config-no-restart: test
test-pulsar: PLAYBOOK = pulsar
test-pulsar: test
test-restart: PLAYBOOK = restart
test-restart: test
test-snapshot: PLAYBOOK = snapshot
test-snapshot: test
test-stack: PLAYBOOK = stack
test-stack: test
test-static: PLAYBOOK = static
test-static: test
test-tpv: PLAYBOOK = tpv
test-tpv: test
testtoolshed-stack_extras: PLAYBOOK = stack_extras
testtoolshed-stack_extras: testtoolshed
testtoolshed-stack: PLAYBOOK = stack
testtoolshed-stack: testtoolshed
testtoolshed-update: PLAYBOOK = update
testtoolshed-update: testtoolshed
test-update: PLAYBOOK = update
test-update: test
test-update-no-restart: PLAYBOOK = update
test-update-no-restart: RESTART_ARG = "-e restart=false"
test-update-no-restart: test
toolshed-stack: PLAYBOOK = stack
toolshed-stack: toolshed
toolshed-update: PLAYBOOK = update
toolshed-update: toolshed
test main testtoolshed toolshed:
ansible-playbook -i env/$@/inventory env/$@/$(PLAYBOOK).yml --diff $(TAGS_ARG) $(LIMIT_ARG) $(RESTART_ARG)
Makefile: Makefile.in
sed "s/^## AUTOGEN TARGETS/$$(bash ./.support/targets.sh)/" Makefile.in > Makefile
.PHONY: test main testtoolshed toolshed