A collection of useful ansible-related shell scripts
Install scripts along with their respective completion scripts
make prefix=<dir on your $PATH> install
... or with sudo
sudo make install
[sudo] make [prefix=<dir on your $PATH>] bash_completion
[sudo] make [prefix=<dir on your $PATH>] zsh_completion
Before running any of these scripts, make sure the environment variable ANSIBLE_PROJECT_DIR
points to an ansible project directory.
List all environments
ansible-environments
List all groups for an environment
ansible-groups [env]
List all hosts for an environment and a group
ansible-hosts [env] [group]
These scripts expect the following directory structure and will not work otherwise:
- environments
- env_a
- inventory
- env_b
- inventory
- ...
- inventory
- make ansible-related stuff work for best practice directory-layouts as well
- support inventory-files in ini format
- add subcommand to permanently configure ansible project dir (replace usage of environment variable
ANSIBLE_PROJECT_DIR
) - add flag to transiently set ansible project dir (don't write this to config)