diff --git a/README.md b/README.md index 294e72e..b76c9a5 100644 --- a/README.md +++ b/README.md @@ -46,9 +46,12 @@ imagebuilder |TAG | A tag that is added to the name| |RAW_OUTPOUT | Set to yes to get the .img file as output| |TOKEN | A token used by Ansible| +|VAULT_KEY | Key to use in the vaultkey.secret file| ### List of flavors +ubuntu24.04 + ubuntu22.04 ubuntu20.04 @@ -69,8 +72,8 @@ Run mount command. Make sure to update the offset (526336) for the correct value `mount ubuntu-22.04.4-preinstalled-server-arm64+raspi.img -o loop,offset=$(( 512 * 526336)) /mnt/` ## How to add my custom secrets file for ansible vaults? -Copy the file in `out/output`. and make sure that the name is NODENAME-vaultkey.secret +To use a custom secret the VAULT_KEY variable can be set. If a vaultkey file of the name NODENAME-vaultkey.secret already exists the variable will be ignored. [![GitHub](https://img.shields.io/github/license/ERIGrid2/riasc-provisioning)](https://github.com/ERIGrid2/riasc-provisioning/blob/master/LICENSE) diff --git a/rpi/create_image.sh b/rpi/create_image.sh index 6c2b814..8c94d5c 100755 --- a/rpi/create_image.sh +++ b/rpi/create_image.sh @@ -86,6 +86,9 @@ echo "Using token: ${TOKEN}" echo "Using flavor: ${FLAVOR}" echo "Using repo: ${GIT_URL}" echo "Using branch: ${GIT_BRANCH}" +if [! -z "$VAULT_KEY" ]; then + echo "Using ansible secret ${VAULT_KEY}" +fi # Check that required commands exist echo "Check if required commands are installed..." @@ -166,8 +169,10 @@ sed -i \ #Generate ansible secret if [ ! -f ${OUTPUT_FOLDER}/"${NODENAME}"-vaultkey.secret ]; then - echo "Generate ansible secret" - VAULT_KEY=$(tr -dc A-Za-z0-9 ${OUTPUT_FOLDER}/"${NODENAME}"-vaultkey.secret #!/bin/bash echo "${VAULT_KEY}"