Skip to main content

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

License

GNU General Public License

Author Information

Zach LeBlanc

Red Hat

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-butler-1.0.8.tar.gz (20.8 kB view details)

Uploaded Source

Built Distribution

ansible_butler-1.0.8-py3-none-any.whl (21.7 kB view details)

Uploaded Python 3

File details

Details for the file ansible-butler-1.0.8.tar.gz.

File metadata

  • Download URL: ansible-butler-1.0.8.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

Hashes for ansible-butler-1.0.8.tar.gz
Algorithm Hash digest
SHA256 e4d865774f9fb7f90d338df25237a0b1bdd9ef2fa4cafbeaaf42d430e22d8653
MD5 5cf62c746e32ef78f1d7c1e3de0b3818
BLAKE2b-256 9d9879e87d81ff5db4f4b18ecdfbbc0b4cddd8cf5425a55aa63e3d819215ea9a

See more details on using hashes here.

File details

Details for the file ansible_butler-1.0.8-py3-none-any.whl.

File metadata

File hashes

Hashes for ansible_butler-1.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 ac8573da8b0b02a86bd3374e98fbbad6d2124820a76d010006442af858ffe4f3
MD5 bd15e500e4f483e2282da2ec13382184
BLAKE2b-256 38816cd34f6988a39d98ff7592d506334619516c2781ae080ce7672fa3cb7f5d

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