-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
56 lines (43 loc) · 2.26 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
.PHONY: prepare
prepare: ### Install workspace env dependencies
@echo "—————————————————————————————— PYTHON REQUIREMENTS ———————————————————————————"
@pip3 install -U pip --no-cache-dir --quiet &&\
echo "[ ${Green}OK${Color_Off} ] ${Yellow}INSTALL${Color_Off} PIP3" || \
echo "[${Red}FAILED${Color_Off}] ${Yellow}INSTALL${Color_Off} PIP3"
@pip3 install -U wheel --no-cache-dir --quiet &&\
echo "[ ${Green}OK${Color_Off} ] ${Yellow}INSTALL${Color_Off} WHEEL" || \
echo "[${Red}FAILED${Color_Off}] ${Yellow}INSTALL${Color_Off} WHEEL"
@pip3 install -U setuptools --no-cache-dir --quiet &&\
echo "[ ${Green}OK${Color_Off} ] ${Yellow}INSTALL${Color_Off} SETUPTOOLS" || \
echo "[${Red}FAILED${Color_Off}] ${Yellow}INSTALL${Color_Off} SETUPTOOLS"
@pip3 install -U --no-cache-dir -q -r requirements.txt &&\
echo "[ ${Green}OK${Color_Off} ] ${Yellow}INSTALL${Color_Off} PIP REQUIREMENTS" || \
echo "[${Red}FAILED${Color_Off}] ${Yellow}INSTALL${Color_Off} PIP REQUIREMENTS"
@echo "————————————————————————————— ANSIBLE REQUIREMENTS ———————————————————————————"
@ansible-galaxy collection install -fr ${PWD}/requirements.yml
@ansible-galaxy role install -fr ${PWD}/requirements.yml
system:
ansible-playbook playbooks/00_system.yml -i inventory --limit="localhost,$(name)"
docker:
ansible-playbook playbooks/01_docker.yml -i inventory --limit=$(name)
bastion:
ansible-playbook playbooks/02_bastion.yml -i inventory --limit=$(name)
new: system docker bastion
.PHONY: new-bastion
new-bastion:
@ [ -n "$(name)" ] || \
( \
echo ----------------------------------- BASTION HOST --------------------------------- && \
echo && \
echo "Usage:\n\tmake new-bastion name=HOSTNAME \n" && \
exit 1 \
)
make new
new-user:
ansible-playbook playbooks/02_bastion.yml -i inventory --tags="adduser"
new-admin:
ansible-playbook playbooks/00_system.yml -i inventory --tags="addadmin"
update-bastion:
ansible-playbook playbooks/02_bastion.yml -i inventory --tags="update-bastion"
update-docker:
ansible-playbook playbooks/02_bastion.yml -i inventory --tags="update-docker"