This repository was archived by the owner on Jun 12, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
70 lines (49 loc) · 1.6 KB
/
Copy pathMakefile
File metadata and controls
70 lines (49 loc) · 1.6 KB
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
DEV_RUN_CONTEXT ?= docker compose exec dev
MOCK_RUN_CONTEXT ?= docker compose exec mock
ANSIBLE_USER=tech
default: .ansible/install
############################################
# container
############################################
build:
docker compose build
up:
docker compose up -d
down:
docker compose down --remove-orphans
clean:
docker compose down --rmi all --volumes --remove-orphans
ps:
docker compose ps -a
logs:
docker compose logs
logs/%:
docker compose logs $(@F)
restart: down up
rebuild: clean up
reset:
docker compose up -d --force-recreate mock
login:
docker compose exec mock login
############################################
# ansible
############################################
.ansible/install:
$(DEV_RUN_CONTEXT) ansible-galaxy collection install -r ./ansible/requirements.yaml
check: .ansible/fmt .ansible/lint .ansible/yamllint .ansible/shellcheck
.ansible/fmt:
$(DEV_RUN_CONTEXT) ansible-lint --config-file "ansible/.ansible-lint" --fix
.ansible/lint:
$(DEV_RUN_CONTEXT) ansible-lint --config-file "ansible/.ansible-lint"
.ansible/yamllint:
$(DEV_RUN_CONTEXT) yamllint .
.ansible/shellcheck:
$(DEV_RUN_CONTEXT) shellcheck init.sh
play:
$(MOCK_RUN_CONTEXT) \
sudo -u "$(ANSIBLE_USER)" \
bash -c "ansible-playbook -i inventories/hosts.yaml playbook.yaml --extra-vars '@/etc/ansible/extra_vars.yaml' --extra-vars 'ansible_user=$(ANSIBLE_USER)'"
play/%:
$(MOCK_RUN_CONTEXT) \
sudo -u "$(ANSIBLE_USER)" \
bash -c "ansible-playbook -i inventories/hosts.yaml playbook.yaml --extra-vars '@/etc/ansible/extra_vars.yaml' --extra-vars 'ansible_user=$(ANSIBLE_USER)' --tags $(@F)"