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.1.0.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ansible_vault_rotate-2.1.0-py3-none-any.whl (14.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ansible_vault_rotate-2.1.0.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.8.20 Linux/6.8.0-1020-aws

File hashes

Hashes for ansible_vault_rotate-2.1.0.tar.gz
Algorithm Hash digest
SHA256 f444aabb9b8e8b5561298edd602cd99f2b892b78a582011a341a9ff8596d006a
MD5 18962213a7d07f0d6db959f0bc53738f
BLAKE2b-256 3e3ed177c2e4e74e51b056039ec572e289b9269b57c0c36f59862470353103b9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ansible_vault_rotate-2.1.0-py3-none-any.whl
  • Upload date:
  • Size: 14.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.8.20 Linux/6.8.0-1020-aws

File hashes

Hashes for ansible_vault_rotate-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6bf19e2d35864ba20bb439f47530996aa9ef81dadb75ecd9508e915d70d04e30
MD5 ec7a149b9ed98320d31fd843b4d81a3e
BLAKE2b-256 14459a3c9690ce6677d461b851a14c6d8de2330a2ad6e7de83342e55990c6a05

See more details on using hashes here.

Supported by

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