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

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 a crypted 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="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.1.0.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

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

ansible_tools-0.1.0-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ansible-tools-0.1.0.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.7

File hashes

Hashes for ansible-tools-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9d90985e947fb934ec182484edc842a3adf80f08189ecc7008638bbc6775992d
MD5 2e250b4b4cc316285cd161bf0bd7a19e
BLAKE2b-256 8fd94fb4aab73c371eccf266c2a83551650436b0b080d5f37ee46faa8a4db1d9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ansible_tools-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.7

File hashes

Hashes for ansible_tools-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e85650f7b019150751a97b8a328171fbeb7e5b0c4336ce942a11493ac9254ab6
MD5 cd910522c54ec2fa05ebc643f0261ec0
BLAKE2b-256 b1cadd9e796559f314c08070192f02b6d6bd741128f33819f939b69c3a2dea54

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