Metadata-Version: 2.4
Name: ansible-tools
Version: 0.3.0
Summary: Keyring integration and local execution wrappers for Ansible
Project-URL: Homepage, https://github.com/lvillani/ansible-tools
Author-email: Lorenzo Villani <lorenzo@villani.me>
License: MIT License
        
        Copyright (c) 2025 Lorenzo Villani
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE.txt
Keywords: ansible,keyring,local,tools,wrapper
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Topic :: System :: Systems Administration
Requires-Python: >=3.8
Requires-Dist: keyring<26,>=25.5.0
Requires-Dist: passlib<2,>=1.7.4
Description-Content-Type: text/markdown

# ansible-tools

[![PyPI Version](https://img.shields.io/pypi/v/ansible-tools.svg)](https://pypi.python.org/pypi/ansible-tools)
[![PyPI Downloads](https://img.shields.io/pypi/dm/ansible-tools.svg)](https://pypi.python.org/pypi/ansible-tools)
[![MIT License](https://img.shields.io/badge/license-mit-blue.svg)](https://choosealicense.com/licenses/mit/)

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](https://docs.ansible.com/ansible/latest/reference_appendices/faq.html#how-do-i-generate-encrypted-passwords-for-the-user-module))

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