-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
46 lines (35 loc) · 1.7 KB
/
Makefile
File metadata and controls
46 lines (35 loc) · 1.7 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
MAKEFLAGS += --always-make --warn-undefined-variables
SHELL=/bin/bash -eu
nc=\033[0m
SSH_USER ?= $${USER}
help: ## Show this help text
grep -h -E '^[a-z]+.*:' $(MAKEFILE_LIST) | \
awk -F ":|#+" '{printf "\033[31m%s $(nc) \n %s $(nc)\n \033[3;37mDepends On: $(nc) [ %s ]\n", $$1, $$3, $$2}'
show-install-ansible: ## Prints commands to install ansible (linux)
# https://docs.ansible.com/ansible/latest/installation_guide/installation_distros.html
@echo sudo apt update
@echo sudo apt install software-properties-common
@echo sudo add-apt-repository --yes --update ppa:ansible/ansible
@echo sudo apt install --yes ansible
deps:
test -n "$${TRIPLEA_ANSIBLE_VAULT_PASSWORD}"
vaultPassword=@echo "$${TRIPLEA_ANSIBLE_VAULT_PASSWORD}" > ansible/vault-password; trap 'rm -f "ansible/vault-password"' EXIT
runAnsible=$(vaultPassword); ANSIBLE_CONFIG="ansible/ansible.cfg" ansible-playbook --vault-password-file ansible/vault-password -e ansible_user=$(SSH_USER)
testInventory=--inventory ansible/inventory/test.inventory
prodInventory=--inventory ansible/inventory/prod.inventory
playbook=ansible/playbook.yml
ansible-galaxy-install:
ansible-galaxy collection install -r ansible/requirements.yml --force
diff-test: ansible-galaxy-install
$(runAnsible) --check --diff $(testInventory) $(playbook)
deploy-test: ansible-galaxy-install
$(runAnsible) $(testInventory) $(playbook)
diff-prod: ansible-galaxy-install
$(runAnsible) --check --diff $(prodInventory) $(playbook)
deploy-prod: ansible-galaxy-install
$(runAnsible) $(prodInventory) $(playbook)
update-bots:
$(ansibleConf) ansible $(EXTRA_ARGS) \
bots -a 'sudo /home/admin/download-all-maps' \
--inventory "$scriptDir/ansible/prod.inventory" \
--verbose