A small tool to quickly ssh into an ansible host group
- Ansible 2.2
- Python 3
- pyyaml
- jinja2
create an .ansishell
file in your home directory:
[inventory]
; "default" is required
default=/home/foobar/myproject/dev_inventory
dev=/home/foobar/myproject/dev_inventory
production=/home/foobar/myproject/production_inventory
[config]
; the command to open multiple shells. Needs to support syntax "$command $host1 $host2 ..."
command=mssh
Add the bin
dir or symlink the executable somewhere in your $PATH
If you want bash completion, source the bashcompletion.sh
or bashcompletion.zsh.sh
For default environment, you can just use the group name as a parameter:
ansishell web
For a specific environment, use it the first parameter:
ansishell dev web
Unsure which groups are configured? Use group listing of an environment:
ansishell dev -l
Need a list of environments?
ansishell -e