Compare commits
1 commit
| Author | SHA1 | Date | |
|---|---|---|---|
| 840c1ad956 |
3 changed files with 3 additions and 33 deletions
|
|
@ -104,12 +104,7 @@ jobs:
|
|||
# Execute the script, passing necessary environment variables
|
||||
bash scripts/run_ansible_ci.sh
|
||||
env:
|
||||
# Provide VMIDs and names, overriding group_vars if desired.
|
||||
# These will be passed as `--extra-vars` to Ansible.
|
||||
ANSIBLE_EXTRA_VARS: >-
|
||||
backup_template_vmid=${{ env.TEMPLATE_VMID | default('9001') }}
|
||||
latest_template_vmid=${{ env.LATEST_TEMPLATE_VMID | default('9000') }}
|
||||
version=${{ steps.version.outputs.tag_name }}
|
||||
IMAGE_VERSION: ${{ steps.version.outputs.tag_name }}
|
||||
|
||||
- name: Extract flake metadata
|
||||
id: meta
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
# NixOS base image for promxox
|
||||
# Nixs base image for promxox
|
||||
This is the nixos base image to be used as a template in proxmox
|
||||
|
||||
## Using this base image
|
||||
|
|
|
|||
|
|
@ -15,34 +15,9 @@ fi
|
|||
cd "${ANSIBLE_DIR}"
|
||||
echo "Changed directory to: $(pwd)"
|
||||
|
||||
# # --- 3. Define Ansible Extra Variables ---
|
||||
# # Base extra variables from our static definitions
|
||||
EXTRA_VARS=(
|
||||
# "local_image_path_ci=${PROXMOX_LOCAL_IMAGE_PATH_FROM_BUILD}" # Path to the image file on the CI runner
|
||||
# "image_filename=$(basename "${PROXMOX_LOCAL_IMAGE_PATH_FROM_BUILD}")" # Extract filename
|
||||
)
|
||||
|
||||
# # Append any other variables passed via ANSIBLE_EXTRA_VARS from the workflow
|
||||
if [[ -n "${ANSIBLE_EXTRA_VARS:-}" ]]; then
|
||||
# Split by space or newline and add to array
|
||||
IFS=$'\n' read -r -d '' -a ADDITIONAL_VARS <<< "${ANSIBLE_EXTRA_VARS}" || true
|
||||
for var in "${ADDITIONAL_VARS[@]}"; do
|
||||
EXTRA_VARS+=("${var}")
|
||||
done
|
||||
fi
|
||||
|
||||
# # --- 4. Execute the Ansible Playbook ---
|
||||
# echo "Executing Ansible playbook: upload-template.yml"
|
||||
|
||||
# # Construct the full --extra-vars string
|
||||
EXTRA_VARS_ARGS=""
|
||||
for var in "${EXTRA_VARS[@]}"; do
|
||||
EXTRA_VARS_ARGS+=" -e ${var}"
|
||||
done
|
||||
|
||||
ansible-playbook upload-template.yml \
|
||||
--inventory inventory/hosts.yml \
|
||||
${EXTRA_VARS_ARGS} # \
|
||||
-e "version=${IMAGE_VERSION:-v0.0.0}" # \
|
||||
# --diff \
|
||||
# --check false # Set to true for a dry run, false for actual execution
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue