Skip to main content

ansible-tools

PyPI Version PyPI Downloads MIT License

This is a set of wrappers around the ansible, ansible-playbook and ansible-vault commands which integrate with the system keyring to retrieve the vault password.

It should work on both Linux and macOS.

Installation

  • On macOS, with Homebrew: brew install lvillani/tap/ansible-tools;
  • With Pip: pip install --user ansible-tools;

It is best, however, to install ansible-tools in a Virtualenv, along with the version of Ansible you are using.

Overview

  • ansible-vault-helper: Used by users to setup keyring integration, called by Ansible to obtain a Vault unlock password.
  • vaultify: Wraps Ansible commands such as ansible, ansible-playbook and ansible-playbook so that the Vault is automatically unlocked with the password stored in the system's keyring.
  • ansible-local: Wrapper to run Ansible locally.
  • ansible-mkpasswd: Generates an encrypted password that can be used with the user module (see also here)

Usage

Go to the same directory that contains your playbooks and then run:

ansible-vault-helper --update

You will be prompted for a vault name (which can be anything) and the unlock password. The former is stored in ansible.cfg alongside your playbooks, the latter is securely stored in your keyring.

At this point you can run Ansible as usual but precede the command with vaultify. That is, to start a playbook run:

vaultify ansible-playbook site.yml

We also ship a tool to easily apply a playbook on the current system called ansible-local which is composable with vaultify.

Aliases

Here's a list of handy shell aliases to make your life easier. They were tested on fish but should work also on Bash and Zsh:

alias v="vaultify"
alias ansible="vaultify ansible"
alias ansible-playbook="vaultify ansible-playbook"

Metadata

Release files for ansible-tools 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ansible-tools 0.5.0
File Size Uploaded
ansible_tools-0.5.0.tar.gz 17.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ansible-tools 0.5.0
File Interpreter ABI Platform
ansible_tools-0.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 28.2 kB

Release files / ansible_tools-0.5.0.tar.gz

Download URL ansible_tools-0.5.0.tar.gz
Size 17.6 kB
Tags Source
SHA-256 checksum
How to use checksums
f9f6fd6a6b3878294d3c621f44abd1abfe8dd9920dd4016aaacfde52a7e3514c
BLAKE2b-256 checksum
How to use checksums
06f9b9a1bf674aa155207c9ac76c7ea9f3caee377e764291a1981f333ffdc03b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.2

Release files / ansible_tools-0.5.0-py3-none-any.whl

Download URL ansible_tools-0.5.0-py3-none-any.whl
Size 10.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e871fcd23e47f8e818270f08216732d979818149f2af560f1ad04387550b600d
BLAKE2b-256 checksum
How to use checksums
24d053193caaa88cd39f4c8fccdb137db32974132946e90865a0e7455428ceba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.2

Release history Release notifications | RSS feed

This release

0.5.0 This release

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.7

1 release file

0.0.6

1 release file

0.0.5

1 release file

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page