Skip to main content

Advanced Python CLI to rotate the secret used for ansible vault inline secrets and files in a project

Project description

python-ansible-vault-rotate

GitHub License pre-commit CircleCI PyPI version codecov Quality Gate Status Maintainability Rating Security Rating

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 details)

Uploaded Source

Built Distribution

ansible_vault_rotate-2.0.0-py3-none-any.whl (14.5 kB view details)

Uploaded Python 3

File details

Details for the file ansible_vault_rotate-2.0.0.tar.gz.

File metadata

  • Download URL: ansible_vault_rotate-2.0.0.tar.gz
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.1 CPython/3.8.16 Linux/5.15.0-1030-aws

File hashes

Hashes for ansible_vault_rotate-2.0.0.tar.gz
Algorithm Hash digest
SHA256 4264d044d247782f45d99686d78f8c21fce8885d91623a5e3b0a8fb706187edf
MD5 df3ea5edb95cdbc8c9b30866bc9c8b6c
BLAKE2b-256 eef91968ba84ee69c606e1485a03201ab45bdcf2b7c9f72574c4e0f6fca75257

See more details on using hashes here.

File details

Details for the file ansible_vault_rotate-2.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ansible_vault_rotate-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3e783ef3f5fbbe22b2b6bbcdabd3496039353d1ecf7749b3108c168ebb6ae6ac
MD5 e2464636e5b15e61220f25439038c220
BLAKE2b-256 eac717dc7e513010427c14bdefc87a247727cc280f81dc395e823a73330214a7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page