Decrypt all ansible vault files recursively for search/editing, then re-encrypt them.
Borrows heavily from the excellent, but no longer supported Ansible Toolkit.
Tested with Ansible v2.5+
./bulk-decrypt-vault.py [open|close]
-
Download
bulk-decrypt-vault.py
and place it at the root of your Ansible directories -
Edit the
VAULT_PASSWORD_PATH
inbulk-decrypt-vault.py
to match your vault file destination -
Run
./bulk-decrypt-vault.py open
to decrypt all vaulted files recursively -
Edit/search plaintext as needed
-
Run
./bulk-decrypt-vault.py close
to re-encrypt any changed filesAny unchanged files will returned to their original state.
pip install ansible ansible-vault pathlib