-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
48 lines (36 loc) · 1.57 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
.PHONY: all help ls-hostname syntax-check lint galaxy-install vaullt-dec vault-enc
ANSIBLE=ansible
PLAYBOOK=ansible-playbook
GALAXY=ansible-galaxy
LINT=ansible-lint
VAULT=ansible-vault
all: help
help:
@echo "Make command examples for Ansible"
@echo " ls-hostname to show all host ips"
@echo " print-vars to print out a dictionary of all of the facts"
@echo " syntax-check to run with --syntax-check option"
@echo " lint to lint playbook files"
@echo " galaxy-install to install roles using ansible-galaxy"
@echo " vault-dec to decrypt secret.yml"
@echo " vault-enc to encrypt secret.yml"
@echo " vault-edit to edit secret.yml"
@echo " vault-view to view secret.yml"
ls-hostname:
$(ANSIBLE) all -i hosts -m shell -a "hostname;"
print-vars:
$(ANSIBLE) api -i hosts -m setup
syntax-check:
$(PLAYBOOK) playbook_dir/*.yml -i hosts --syntax-check
lint:
$(LINT) playbook_dir/*.yml
galaxy-install:
$(GALAXY) install -r ./roles/requirements.yml --roles-path ./roles
vault-dec:
$(VAULT) decrypt hosts/group_vars/secret.yml --vault-password-file ./.secret/vault_password
vault-enc:
$(VAULT) encrypt hosts/group_vars/secret.yml --vault-password-file ./.secret/vault_password
vault-edit:
$(VAULT) edit hosts/group_vars/secret.yml --vault-password-file ./.secret/vault_password
vault-view:
$(VAULT) view hosts/group_vars/secret.yml --vault-password-file ./.secret/vault_password