mirror of
https://github.com/cole-maxwell1/todo-hetzner.git
synced 2026-10-27 19:02:49 -05:00
ops(ansible): configure local vault password file
Add an ignored example-backed password file for non-interactive deployments and document the external password file override.
This commit is contained in:
@@ -363,10 +363,22 @@ cd ansible
|
||||
ansible-playbook -i inventory/hosts.yml playbooks/setup-node.yml --ask-vault-pass
|
||||
```
|
||||
|
||||
The Make deployment target loads `ansible/ansible.cfg` by changing into that directory and regenerates inventory before deployment. Configure `ANSIBLE_VAULT_PASSWORD_FILE` so both playbooks can unlock the Vault files non-interactively:
|
||||
For non-interactive deployments, Ansible needs a file containing the password used to encrypt all three Vault files. The project configuration defaults to `ansible/.vault_pass.txt`; create it from the example, replace the placeholder with the Vault password, and restrict its permissions:
|
||||
|
||||
```sh
|
||||
cp ansible/.vault_pass.txt.example ansible/.vault_pass.txt
|
||||
chmod 600 ansible/.vault_pass.txt
|
||||
```
|
||||
|
||||
`ansible/.vault_pass.txt` is ignored by Git and must never be committed. All three Vault files must use the password stored in this file. To keep the password outside the repository instead, set `ANSIBLE_VAULT_PASSWORD_FILE`:
|
||||
|
||||
```sh
|
||||
export ANSIBLE_VAULT_PASSWORD_FILE="$HOME/.config/ansible/todo-vault-password"
|
||||
```
|
||||
|
||||
The Make deployment target loads `ansible/ansible.cfg`, regenerates inventory, and unlocks the Vault files non-interactively:
|
||||
|
||||
```sh
|
||||
make deploy-ansible
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user