makefile: Added rules for load/store credentials

dehydrated
Felix Stupp 5 years ago
parent e24f0f5f29
commit e854aed62a
Signed by: zocker
GPG Key ID: 93E1BD26F6B02FB7

@ -1,8 +1,9 @@
vault:=group_vars/all/vault.yml
playbooks_dir:=playbooks
playbooks:=$(wildcard ${playbooks_dir}/*.yml)
credentials_dir:=credentials
.PHONY: main list vault ${playbooks}
.PHONY: main list vault ${playbooks} store-credentials load-credentials
main:
ansible-playbook site.yml
@ -15,3 +16,11 @@ vault:
${playbooks}:
ansible-playbook ${playbooks_dir}/$@.yml
store-credentials: credentials.tar.gpg
credentials.tar.gpg: $(shell find "${credentials_dir}" -type f)
tar -cf - "${credentials_dir}" | gpg --encrypt --recipient 73D09948B2392D688A45DC8393E1BD26F6B02FB7 > "$@"
load-credentials:
< credentials.tar.gpg gpg --decrypt | tar -xf -

Loading…
Cancel
Save