dploy is a meta CLI for Ansible which enable multi inventory deployment while providing smart completion.
It supports ansible-playbook and ansible command
curl -ssf -L https://raw.githubusercontent.com/ca-gip/dploy/master/install.sh | bashAdding completion for bash (also available for zsh and fish)
echo "source <(dploy completion bash)" >> ~/.bashrc
dploy -h
Ansible deployment toolbox
Usage:
dploy [command]
Available Commands:
completion Generate completion script
exec Run Ad Hoc command
generate Generate ansible-playbook command
help Help about any command
play Run ansible-playbook commandAll subcommand use a --filter arguments that will select inventories based on the vars declared under [all:vars] in *.ini files.
Filter implement the following operators to match variable value:
- Equal
== - NotEqual
!= - EndWith
$= - Contains
~= - StartWith
^=
Filtering is based on the location where the command is executed as it will recursively search all *.ini files.
Launch a playbook
dploy play --filter platform==os -p upgrade-proxy.ymlCompletion is available for :
--playbookonly yaml files that are valid playbooks will be shown--tagsa playbook must selected beforehand
Execute Ad Hoc command
dploy exec --filter customer==os -m ping -p lbCompletion is available for :
--patternit will list all groups and host present in inventories files