Skip to main content

Keyring integration and local execution wrappers for Ansible

Project description

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"

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_tools-0.5.0.tar.gz (17.6 kB view details)

Uploaded Source

Built Distribution

ansible_tools-0.5.0-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

Details for the file ansible_tools-0.5.0.tar.gz.

File metadata

  • Download URL: ansible_tools-0.5.0.tar.gz
  • Upload date:
  • Size: 17.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.2

File hashes

Hashes for ansible_tools-0.5.0.tar.gz
Algorithm Hash digest
SHA256 f9f6fd6a6b3878294d3c621f44abd1abfe8dd9920dd4016aaacfde52a7e3514c
MD5 8805a464a6cfeb9ece1a57127ecad5eb
BLAKE2b-256 06f9b9a1bf674aa155207c9ac76c7ea9f3caee377e764291a1981f333ffdc03b

See more details on using hashes here.

File details

Details for the file ansible_tools-0.5.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ansible_tools-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e871fcd23e47f8e818270f08216732d979818149f2af560f1ad04387550b600d
MD5 2e3673ce936f7344e1b209ae44b8580d
BLAKE2b-256 24d053193caaa88cd39f4c8fccdb137db32974132946e90865a0e7455428ceba

See more details on using hashes here.

Supported by

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