add option to pass Ansible vault password
continuous-integration/drone/push Build is passing Szczegóły
continuous-integration/drone/tag Build is passing Szczegóły

This commit is contained in:
Robert Kaussow 2020-10-08 11:13:26 +02:00
rodzic 0bd446408b
commit d9ce8cf1df
Podpisane przez: xoxys
ID klucza GPG: 65362AE74AF98B61
3 zmienionych plików z 13 dodań i 3 usunięć

Wyświetl plik

@ -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.

Wyświetl plik

@ -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

Wyświetl plik

@ -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 "$@"