https://github.com/ca-gip/dploy
A meta CLI for Ansible which enable multi inventory deployment while providing smart completion
https://github.com/ca-gip/dploy
ansilbe cli
Last synced: 6 months ago
JSON representation
A meta CLI for Ansible which enable multi inventory deployment while providing smart completion
- Host: GitHub
- URL: https://github.com/ca-gip/dploy
- Owner: ca-gip
- License: mit
- Created: 2020-12-17T11:11:59.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-12-16T13:29:46.000Z (over 4 years ago)
- Last Synced: 2024-06-19T05:48:21.198Z (about 2 years ago)
- Topics: ansilbe, cli
- Language: Go
- Homepage:
- Size: 283 KB
- Stars: 7
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# dploy

[](https://coveralls.io/github/ca-gip/dploy)

[](https://goreportcard.com/report/github.com/ca-gip/dploy)

`dploy` is a meta CLI for Ansible which enable multi inventory deployment while providing smart completion.
It supports `ansible-playbook` and `ansible` command
### Intallation
```bash
curl -ssf -L https://raw.githubusercontent.com/ca-gip/dploy/master/install.sh | bash
```
Adding completion for bash (also available for zsh and fish)
```
echo "source <(dploy completion bash)" >> ~/.bashrc
```
## Usage
```bash
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 command
```
### How to select inventories ?
All 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.
### Subcommands
#### Play
Launch a playbook
```bash
dploy play --filter platform==os -p upgrade-proxy.yml
```
Completion is available for :
* `--playbook` only yaml files that are valid playbooks will be shown
* `--tags` a playbook must selected beforehand
#### Exec
Execute Ad Hoc command
```bash
dploy exec --filter customer==os -m ping -p lb
```
Completion is available for :
* `--pattern` it will list all groups and host present in inventories files