You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible/makefile

27 lines
633 B
Makefile

vault:=group_vars/all/vault.yml
playbooks_dir:=playbooks
playbooks:=$(wildcard ${playbooks_dir}/*.yml)
credentials_dir:=credentials
.PHONY: main list vault ${playbooks} store-credentials load-credentials
main:
ansible-playbook site.yml
list:
@echo ${playbooks}
vault:
ansible-vault edit ${vault}
${playbooks}:
ansible-playbook ${playbooks_dir}/$@.yml
store-credentials: credentials.tar.gpg
credentials.tar.gpg: $(shell find "${credentials_dir}")
tar -cf - "${credentials_dir}" | gpg --encrypt --recipient 73D09948B2392D688A45DC8393E1BD26F6B02FB7 > "$@"
load-credentials:
< credentials.tar.gpg gpg --decrypt | tar -xf -