Skip to content

Commit 6a9edfa

Browse files
dguidoclaude
andauthored
Auto-install Ansible Galaxy collections before deployment (trailofbits#14924)
After PR trailofbits#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 trailofbits#14923 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent a7babef commit 6a9edfa

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ RUN uv sync --locked --no-dev
3030
# Copy application code
3131
COPY . .
3232

33+
# Install Ansible Galaxy collections for cloud provider modules
34+
RUN uv run ansible-galaxy collection install -r requirements.yml
35+
3336
# Set executable permissions and prepare runtime
3437
# Note: /algo must remain root-owned for --cap-drop=all compatibility
3538
# (root without CAP_DAC_OVERRIDE cannot write to files owned by others)

algo

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,12 @@ if ! command -v uv &> /dev/null; then
152152
echo "✓ uv installed successfully via ${UV_INSTALL_METHOD}!"
153153
fi
154154

155+
# Install Ansible Galaxy collections if requirements.yml exists
156+
# This is needed for cloud providers that use collection modules (Linode, DigitalOcean, Azure, etc.)
157+
if [ -f "requirements.yml" ]; then
158+
uv run ansible-galaxy collection install -r requirements.yml > /dev/null 2>&1 || true
159+
fi
160+
155161
# Run the appropriate playbook
156162
case "$1" in
157163
update-users)

0 commit comments

Comments
 (0)