add option to pass Ansible vault password
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/tag Build is passing Details

This commit is contained in:
Robert Kaussow 2020-10-08 11:13:26 +02:00
bovenliggende 0bd446408b
commit d9ce8cf1df
Getekend door: xoxys
GPG sleutel-ID: 65362AE74AF98B61
3 gewijzigde bestanden met toevoegingen van 13 en 3 verwijderingen

Bestand weergeven

@ -1,2 +1,5 @@
- INTERNAL
- migrate to `thegeeklab` namespace
- ENHANCEMENT
- Add env variable `MOLECULE_ANSIBLE_VAULT_PASSWORD`.
If the variable is set, the value is written to
`ANSIBLE_VAULT_PASSWORD_FILE=/root/.vaultpasswd and
passed to molecule.

Bestand weergeven

@ -26,6 +26,10 @@ MOLECULE_PLUGINS_DIR=$(pwd)/plugins
# If you have custom filters you can specify a git repo containing these files.
# Will be cloned to $MOLECULE_PLUGINS_DIR/filter
MOLECULE_CUSTOM_FILTERS_REPO=
# If the variable is set, the value is written to `ANSIBLE_VAULT_PASSWORD_FILE=/root/.vaultpasswd
and automatically passed to molecule.
MOLECULE_ANSIBLE_VAULT_PASSWORD=my_secret
```
## License

Bestand weergeven

@ -21,4 +21,7 @@ if [ -n "${MOLECULE_CUSTOM_FILTERS_REPO}" ]; then
git clone "$MOLECULE_CUSTOM_FILTERS_REPO" "$WORKDIR" 2> /dev/null
fi
exec /usr/local/bin/molecule "$@"
touch /root/.vaultpasswd
echo "${MOLECULE_ANSIBLE_VAULT_PASSWORD}" > /root/.vaultpasswd
exec env ANSIBLE_VAULT_PASSWORD_FILE=/root/.vaultpasswd /usr/local/bin/molecule "$@"