Browse Source

add option to pass Ansible vault password

tags/v3.0.8-4
Robert Kaussow 3 months ago
parent
commit
d9ce8cf1df
Signed by: xoxys GPG Key ID: 65362AE74AF98B61
3 changed files with 13 additions and 3 deletions
  1. +5
    -2
      CHANGELOG.md
  2. +4
    -0
      README.md
  3. +4
    -1
      overlay/bin/molecule

+ 5
- 2
CHANGELOG.md View File

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

+ 4
- 0
README.md View File

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


+ 4
- 1
overlay/bin/molecule View File

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

Loading…
Cancel
Save