This project uses Ansible Vault to encrypt sensitive information like API keys, passwords, and SSH keys.
├── group_vars/
│ ├── oracle_hosts.yml # Plain text variables (safe to commit)
│ └── oracle_hosts_vault.yml # Encrypted secrets (safe to commit)
├── .vault_password.template # Template for vault password
├── .vault_password # Your actual vault password (DO NOT COMMIT)
└── .gitignore # Excludes .vault_password from git
-
Set your vault password:
cp .vault_password.template .vault_password nano .vault_password # Replace with your secure password chmod 600 .vault_password -
Edit encrypted secrets:
ansible-vault edit group_vars/oracle_hosts_vault.yml
-
Update your secrets in the vault file:
vault_tailscale_auth_key: Your Tailscale auth keyvault_borg_repository: Your backup repository URLvault_borg_ssh_user: Backup server usernamevault_borg_ssh_host: Backup server hostnamevault_borg_passphrase: Secure passphrase for Borg encryption
# Password is automatically read from .vault_password
ansible-playbook site.yml
# Or manually specify password
ansible-playbook site.yml --ask-vault-pass
ansible-playbook site.yml --vault-password-file /path/to/password/file# Edit encrypted file
ansible-vault edit group_vars/oracle_hosts_vault.yml
# View encrypted file
ansible-vault view group_vars/oracle_hosts_vault.yml
# Change vault password
ansible-vault rekey group_vars/oracle_hosts_vault.yml
# Decrypt file (temporarily)
ansible-vault decrypt group_vars/oracle_hosts_vault.yml
# Re-encrypt file
ansible-vault encrypt group_vars/oracle_hosts_vault.yml- Edit the vault file:
ansible-vault edit group_vars/oracle_hosts_vault.yml - Add new variable:
vault_new_secret: "secret_value" - Reference in main config:
new_secret: "{{ vault_new_secret }}"
- Never commit
.vault_password- it's in .gitignore - Use strong vault passwords - consider using a password manager
- Rotate secrets regularly
- Use different vault passwords for different environments
- Backup your vault password securely
- Ensure
.vault_passwordfile exists and has correct password - Check file permissions:
chmod 600 .vault_password
- Verify vault password is correct
- Check if file is actually encrypted:
file group_vars/oracle_hosts_vault.yml
ansible-playbook site.yml --ask-vault-pass