27 lines
763 B
Makefile
27 lines
763 B
Makefile
# Password size
|
|
size ?= 256
|
|
# Password
|
|
password ?= $(shell pwgen -1s $(size))
|
|
|
|
alpines: inventory/inventory.yml
|
|
ansible-playbook -i $< --vault-pass-file vault.key alpines.yml
|
|
|
|
dockers: inventory/inventory.yml
|
|
ansible-playbook -i $< --vault-pass-file vault.key dockers.yml
|
|
|
|
inventory: inventory/inventory.yml
|
|
ansible-inventory -i $< --list
|
|
|
|
encrypt-string: vault.key
|
|
@echo name=\"$(name)\" is the variable name
|
|
@test -n "$(name)"
|
|
@echo host=\"$(host)\" is a host file
|
|
@test -f "host_vars/$(host).yml"
|
|
@ansible-vault encrypt_string "$(password)" --name "$(name)" --vault-pass-file $< >> "host_vars/$(host).yml"
|
|
|
|
vault.key:
|
|
@echo Creating a vault password on $@. Keep this file safe!
|
|
@echo -n "$(password)" > $@
|
|
|
|
test:
|
|
haini.sh bundle exec rake spec:all
|