capi: allow configuring Ansible Galaxy installs - #2081
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/retest |
e6d7a63 to
1014184
Compare
a8c671f to
4a6c90f
Compare
drew-viles
left a comment
There was a problem hiding this comment.
Seems logical to me!
/ok-to-test
5050799 to
5994aa5
Compare
5994aa5 to
0f672d1
Compare
|
/retest |
|
/label tide/merge-method-squash |
0f672d1 to
c1abd49
Compare
mboersma
left a comment
There was a problem hiding this comment.
Could we address a few propagation and security issues before merging?
Galaxy credentials may leak through tracing/process arguments, custom install paths aren’t always added to Ansible’s runtime search path, make can evaluate $() in environment-provided paths, and the GCE su - packer flow drops the new Galaxy variables.
4439327 to
eb020b7
Compare
|
Thanks for the detailed feedback. I addressed all four propagation/security points in commit
Changed files:
Validation:
The broader shellcheck invocation still reports pre-existing warnings in unchanged CI/helper code ( |
bba786d to
e30d0cd
Compare
|
Follow-up on EasyCLA: the failure was caused by the I amended only that commit message (no code/tree changes), preserving Maximilian Rink as author and committer. The final commit is |
|
/test pull-ova-all |
Signed-off-by: Maximilian Rink <maximilian.rink@telekom.de>
Address review feedback on the Ansible Galaxy install helper: - Suspend xtrace around both the ANSIBLE_GALAXY_TOKEN condition check and the final ansible-galaxy invocation in ansible_galaxy_collection_install, restoring the previous xtrace state afterward. Without this, DEBUG=1 ANSIBLE_GALAXY_TOKEN=... make deps wrote the token to the build log. - When ANSIBLE_GALAXY_COLLECTIONS_PATH is set, also export the standard ANSIBLE_COLLECTIONS_PATH so Ansible can discover the installed collections at provisioning time, not just during the ansible-galaxy install step. Signed-off-by: Maximilian Rink <maximilian.rink@telekom.de>
Prevent token exposure via process args, make custom collection paths available at runtime without evaluating env-provided \ in make, and preserve Galaxy-related env vars across GCE su - packer runs.
e30d0cd to
1932d48
Compare
What this PR does / why we need it
make depscurrently installs required Ansible collections directly from the default Ansible Galaxy configuration. That makes it hard to use image-builder in environments that require a Galaxy mirror, private Automation Hub, pre-warmed collection cache, custom timeout, or offline collection installation.This adds a small shared helper for CAPI dependency scripts so collection installs can be configured through environment variables while keeping the default behavior unchanged.
Supported variables:
ANSIBLE_GALAXY_SERVERANSIBLE_GALAXY_TOKENANSIBLE_GALAXY_IGNORE_CERTS=trueANSIBLE_GALAXY_TIMEOUTANSIBLE_GALAXY_COLLECTIONS_PATHANSIBLE_GALAXY_NO_CACHE=trueANSIBLE_GALAXY_OFFLINE=trueThe PR intentionally keeps this generic. It does not add any project-specific mirror URLs, credentials, or cache layout assumptions.
Which issue(s) this PR fixes
None
Testing
bash -n images/capi/hack/utils.sh images/capi/hack/ensure-ansible.sh images/capi/hack/ensure-s3.shgit diff --checkshellcheck -x -P images/capi images/capi/hack/utils.sh images/capi/hack/ensure-ansible.sh images/capi/hack/ensure-s3.sh/bin/bash3.2 stubbedansible-galaxyregression check with noANSIBLE_GALAXY_*variables set/bin/bash3.2 stubbedansible-galaxyargument check covering server, token, ignore-certs, timeout, collections-path, no-cache, and offline options