2022-04-10 00:29:22 +00:00
|
|
|
# Password size
|
|
|
|
size ?= 256
|
|
|
|
# Password
|
|
|
|
password ?= $(shell pwgen -1s $(size))
|
|
|
|
|
2023-02-10 21:19:09 +00:00
|
|
|
alpines: inventory/inventory.yml
|
2022-04-10 00:29:22 +00:00
|
|
|
ansible-playbook -i $< --vault-pass-file vault.key alpines.yml
|
|
|
|
|
2023-02-10 21:19:09 +00:00
|
|
|
dockers: inventory/inventory.yml
|
2022-04-10 00:29:22 +00:00
|
|
|
ansible-playbook -i $< --vault-pass-file vault.key dockers.yml
|
|
|
|
|
2023-02-10 21:19:09 +00:00
|
|
|
inventory: inventory/inventory.yml
|
2022-04-10 00:29:22 +00:00
|
|
|
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)" > $@
|
2022-07-02 19:58:59 +00:00
|
|
|
|
|
|
|
test:
|
|
|
|
haini.sh bundle exec rake spec:all
|