Skip to main content

Keyring integration and local execution wrappers for Ansible

Project description

ansible-tools

PyPI 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 OS X.

Installation

If you are on OS X and have Homebrew’s Python:

pip install ansible-tools

Otherwise:

pip install --user ansible-tools

Then make sure to add the local pip’s bin directory to the $PATH. Since it is different on each platform, please refer to its documentation.

Otherwise, if you’re feeling a badass and want to sudo your way out, then run:

sudo pip install ansible-tools

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="vault"
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.0.7.tar.gz (5.2 kB view details)

Uploaded Source

File details

Details for the file ansible-tools-0.0.7.tar.gz.

File metadata

  • Download URL: ansible-tools-0.0.7.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for ansible-tools-0.0.7.tar.gz
Algorithm Hash digest
SHA256 38dd636c4fdced19633fef535f73274c4ff807da0b897070d957be6572a5bc3c
MD5 236108fae28b0b4ea65e85927e02d77f
BLAKE2b-256 93678592fa7ef690e513be1d124f873f7038b1f00a8f55b1ca18ce69d0e8e15b

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