A butler CLI for assistance in managing Ansible projects
Project description
ansible-butler
Butler CLI for Ansible projects
Functions
Object | Action | Description |
---|---|---|
directory | init | initialize an ansible directory |
directory | init | cleanup an ansible directory |
role | list | list roles |
role | clean | clean role directory structure (remove empty yml files & dirs) |
role | mk-readme | auto generate readme based on role meta and basic yml info |
Usage
Usage:
ansible-butler directory init [<dir>] [--config=PATH]
ansible-butler directory clean [<dir>] [--skip-roles]
ansible-butler role list [--roles-path=PATH] [<name>]
ansible-butler role clean [--roles-path=PATH] [<name>]
ansible-butler role mk-readme [--roles-path=PATH] [<name>]
Arguments:
name name of role (accepts glob patterns)
dir path to directory [default: ./]
Options:
-h --help Show this screen
--config=PATH Path to config file
--roles-path=PATH Path to roles directory [default: ./roles]
--skip-roles Flag to skip cleaning roles
Examples
- Initialize Ansible Directory
ansible-butler directory init ./sandbox
ansible-butler directory init ./sandbox --config=~/configs/ansible-butler.yml
- Clean an Ansible Directory
ansible-butler directory clean ./sandbox
ansible-butler directory clean ./sandbox --skip-roles
- Clean Roles
ansible-butler role clean my-role-1
ansible-butler role clean my-role-*
- Generate README
ansible-butler role mk-readme my-role-1
ansible-butler role mk-readme my-role-*
Configuration
Create an .ansible-butler.yml
in one or more of the following locations:
/etc/ansible-butler/ ## least precedence
~/
./ ## highest precedence
You can also specify a specific path at runtime via the --config
option.
# Configuration Schema
role: {}
directory:
init:
folders:
- name: plugins
folders:
...
files:
- README.md
files:
- playbook.yml
🔗 Default configuration file
🔗 Example adding test plugins directory
Troubleshooting
ansible-butler: command not found
- check the $PATH environment variable and ensure that
~/.local/bin
is included
- check the $PATH environment variable and ensure that
License
GNU General Public License
Author Information
Zach LeBlanc
Red Hat
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ansible-butler-1.0.7.tar.gz
(20.8 kB
view details)
Built Distribution
File details
Details for the file ansible-butler-1.0.7.tar.gz
.
File metadata
- Download URL: ansible-butler-1.0.7.tar.gz
- Upload date:
- Size: 20.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6cc87996bf6b8eb9ea4a305a3720daec417e214c3a319003e9e6f26cacfcc79b |
|
MD5 | c47190346ed219b2c6817cd4a79e4182 |
|
BLAKE2b-256 | aaf9ae6538e7c57497f367c254d7a89281af46b794d47fa920f2d6f7893ffc4b |
File details
Details for the file ansible_butler-1.0.7-py3-none-any.whl
.
File metadata
- Download URL: ansible_butler-1.0.7-py3-none-any.whl
- Upload date:
- Size: 21.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac4cf47a92738bc5879c77dad344eac61603fee0fe83da91f8574970a5c9bd52 |
|
MD5 | d37916f75cc3a3cc792fa648b4c55aca |
|
BLAKE2b-256 | 4d7fb579394854238244571b97c507d30922edef986f5b6d4043eeb0dd9c238c |