Advanced Python CLI to rotate the secret used for ansible vault inline secrets and files in a project
Project description
python-ansible-vault-rotate
Advanced Python CLI to rotate the secret used for ansible vault inline secrets and files in a project
Features
- Reencrypt vault files
- Reencrypt inline vaulted secrets
Installation
It is strongly recommended to use pipx instead of pip if possible:
pipx install ansible-vault-rotate
Otherwise you can also use plain pip, but be warned that this might collide with your ansible installation globally!
pip install ansible-vault-rotate
Usage
Rekey given vault secret with new secret specified on CLI
ansible-vault-rotate --old-vault-secret-source file://my-vault-password \
--new-vault-secret-source my-new-secret \
--update-source-secret
Rekey only specific files (e.g. when using multiple keys per stage)
ansible-vault-rotate --old-vault-secret-source file://my-vault-password-<stage> \
--new-vault-secret-source my-new-secret \
--file-glob-pattern group_vars/<stage>/*.yml \
--update-source-secret
Getting help about all args
ansible-vault-rotate --help
Development
For development, you will need:
- Python 3.9 or greater
- Poetry
Install
poetry install
Run tests
poetry run pytest
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ansible_vault_rotate-2.0.0.tar.gz
(10.2 kB
view hashes)
Built Distribution
Close
Hashes for ansible_vault_rotate-2.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4264d044d247782f45d99686d78f8c21fce8885d91623a5e3b0a8fb706187edf |
|
MD5 | df3ea5edb95cdbc8c9b30866bc9c8b6c |
|
BLAKE2b-256 | eef91968ba84ee69c606e1485a03201ab45bdcf2b7c9f72574c4e0f6fca75257 |
Close
Hashes for ansible_vault_rotate-2.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e783ef3f5fbbe22b2b6bbcdabd3496039353d1ecf7749b3108c168ebb6ae6ac |
|
MD5 | e2464636e5b15e61220f25439038c220 |
|
BLAKE2b-256 | eac717dc7e513010427c14bdefc87a247727cc280f81dc395e823a73330214a7 |