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="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.2.0.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

ansible_tools-0.2.0-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ansible-tools-0.2.0.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.8.2

File hashes

Hashes for ansible-tools-0.2.0.tar.gz
Algorithm Hash digest
SHA256 222e79eb282ce97168feb018080729ea5b94d1e7087ed8714b0418d9f3115029
MD5 8fab3e9c58406762576a10e88b2a7a5c
BLAKE2b-256 8c6b031fe4f7dc67a41459e1ad6ee62b059e7b701c94ff1f38fd5b182e8fdc13

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ansible_tools-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.8.2

File hashes

Hashes for ansible_tools-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 895ffbc9f827b94a5a45089d7e6f6d7c3369a239c8a6218375d867a3bc49da19
MD5 0c06e765d7c2bca405cd90d4624f63e7
BLAKE2b-256 2286e9035ecc9fef6a60408eb2b61838b36933001def89b3842fb25874642f4b

See more details on using hashes here.

Supported by

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