Read vault password from bitwarden instead of filesystem
https://theorangeone.net/posts/ansible-vault-bitwarden/
This commit is contained in:
parent
b50659ab5d
commit
9e473265a5
5 changed files with 6 additions and 3 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -112,7 +112,6 @@ dmypy.json
|
||||||
|
|
||||||
# End of https://www.gitignore.io/api/python,ansible
|
# End of https://www.gitignore.io/api/python,ansible
|
||||||
env/
|
env/
|
||||||
ansible/.vault_pass
|
|
||||||
ansible/galaxy_roles
|
ansible/galaxy_roles
|
||||||
ansible/galaxy_collections
|
ansible/galaxy_collections
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
### Private Settings
|
### Private Settings
|
||||||
|
|
||||||
The ansible vault password needs setting in `ansible/.vault_pass`.
|
Ansible [integrates](https://theorangeone.net/posts/ansible-vault-bitwarden/) with Bitwarden through its [CLI](https://bitwarden.com/help/article/cli/).
|
||||||
|
|
||||||
Terraform configuration needs to be placed in `terraform/secrets.auto.tfvars`.
|
Terraform configuration needs to be placed in `terraform/secrets.auto.tfvars`.
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,7 @@ collections_path = $PWD/galaxy_collections
|
||||||
inventory = ./hosts
|
inventory = ./hosts
|
||||||
become_ask_pass = True
|
become_ask_pass = True
|
||||||
interpreter_python = auto
|
interpreter_python = auto
|
||||||
|
vault_password_file = ./vault-pass.sh
|
||||||
|
|
||||||
[ssh_connection]
|
[ssh_connection]
|
||||||
pipelining = True
|
pipelining = True
|
||||||
|
|
3
ansible/vault-pass.sh
Executable file
3
ansible/vault-pass.sh
Executable file
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
bw get password infrastructure
|
|
@ -4,4 +4,4 @@ set -ex
|
||||||
|
|
||||||
cd ansible/
|
cd ansible/
|
||||||
|
|
||||||
time ansible-playbook main.yml -K --vault-password-file .vault_pass $@
|
time ansible-playbook main.yml -K $@
|
||||||
|
|
Loading…
Reference in a new issue