From 6a9edfabc8e6d87fa783aa5e7d22760efabb45fc Mon Sep 17 00:00:00 2001 From: Dan Guido Date: Mon, 8 Dec 2025 10:03:19 -0500 Subject: [PATCH] Auto-install Ansible Galaxy collections before deployment (#14924) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After PR #14908 migrated cloud providers to Ansible collections, users deploying to Linode (and other providers using collections) get errors because the collections aren't automatically installed. This adds automatic collection installation to: - The `algo` script (runs before playbook execution) - The Dockerfile (baked into the image at build time) Fixes #14923 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.5 --- Dockerfile | 3 +++ algo | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/Dockerfile b/Dockerfile index fe011574..90fdd1e6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,6 +30,9 @@ RUN uv sync --locked --no-dev # Copy application code COPY . . +# Install Ansible Galaxy collections for cloud provider modules +RUN uv run ansible-galaxy collection install -r requirements.yml + # Set executable permissions and prepare runtime # Note: /algo must remain root-owned for --cap-drop=all compatibility # (root without CAP_DAC_OVERRIDE cannot write to files owned by others) diff --git a/algo b/algo index fc320f41..1ebb0950 100755 --- a/algo +++ b/algo @@ -152,6 +152,12 @@ if ! command -v uv &> /dev/null; then echo "✓ uv installed successfully via ${UV_INSTALL_METHOD}!" fi +# Install Ansible Galaxy collections if requirements.yml exists +# This is needed for cloud providers that use collection modules (Linode, DigitalOcean, Azure, etc.) +if [ -f "requirements.yml" ]; then + uv run ansible-galaxy collection install -r requirements.yml > /dev/null 2>&1 || true +fi + # Run the appropriate playbook case "$1" in update-users)