Update image and README
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
52c347c342
commit
051c88729b
2 changed files with 72 additions and 33 deletions
44
README.md
44
README.md
|
|
@ -2,14 +2,46 @@
|
|||
|
||||
# ansible-docker
|
||||
|
||||
ansible in a container
|
||||
## Description
|
||||
|
||||
It include hashicorp vault and kubectl binary
|
||||
This project run ansible from a docker image.
|
||||
|
||||
You can use it with something like that :
|
||||
You need docker install on your desktop.
|
||||
|
||||
It include kubectl and helm binary
|
||||
|
||||
## Configure your environnement on Linux
|
||||
|
||||
You can use it with something like that in your ~/.bash_profile or ~/.bashrc :
|
||||
|
||||
```bash
|
||||
alias ansible-playbook='docker run --rm --dns=192.168.18.11 -ti -v $(pwd):/ansible/playbooks -v ~/.kube:/root/.kube -e VAULT_ADDR=$VAULT_ADDR -e VAULT_TOKEN="$(cat ~/.vault-token)" registry.example.net/ansible-docker:latest ansible-playbook'
|
||||
|
||||
ansible-playbook main.yml
|
||||
ansible-docker() {
|
||||
docker run --rm -ti -u $(id -u):$(id -g) --hostname $(hostname -s) \
|
||||
-v /etc/passwd:/etc/passwd:ro -v /etc/group:/etc/group:ro -v /etc/shadow:/etc/shadow:ro \
|
||||
-v $(pwd):/ansible/playbooks -v ~/.kube:/home/$USER/.kube -v ~/.ansible:/home/$USER/.ansible \
|
||||
-e SSH_AUTH_SOCK="$SSH_AUTH_SOCK" -v $SSH_AUTH_SOCK:$SSH_AUTH_SOCK -v ~/.ssh:/home/$USER/.ssh \
|
||||
-v ~/.config:/home/$USER/.config -v ~/.cache:/home/$USER/.cache \
|
||||
quay.io/adrilinux/ansible:latest "$@"
|
||||
}
|
||||
alias ansible="ansible-docker ansible"
|
||||
alias ansible-config="ansible-docker ansible-config"
|
||||
alias ansible-connection="ansible-docker ansible-connection"
|
||||
alias ansible-console="ansible-docker ansible-console"
|
||||
alias ansible-doc="ansible-docker ansible-doc"
|
||||
alias ansible-galaxy="ansible-docker ansible-galaxy"
|
||||
alias ansible-inventory="ansible-docker ansible-inventory"
|
||||
alias ansible-playbook="ansible-docker ansible-playbook"
|
||||
alias ansible-pull="ansible-docker ansible-pull"
|
||||
alias ansible-test="ansible-docker ansible-test"
|
||||
alias ansible-vault="ansible-docker ansible-vault"
|
||||
```
|
||||
|
||||
Then you can run playbook like this:
|
||||
|
||||
```bash
|
||||
ansible-playbook -i inventories/local/ playbook.yml -l my_server --diff --check
|
||||
```
|
||||
|
||||
## Configure your environnement on Windows
|
||||
|
||||
Not tested actually, but help are welcome.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue