Fix Scaleway deployment by replacing broken organization_info module (fixes #14846)#14848
Fix Scaleway deployment by replacing broken organization_info module (fixes #14846)#14848
Conversation
…ixes #14846) The scaleway_organization_info Ansible module is broken and returns empty data due to using a deprecated API endpoint (upstream issue ansible-collections/community.general#3782). This causes deployments to fail with "'NoneType' object has no attribute 'get'" error. Changes: - Replace broken scaleway_organization_info module with user prompt for Organization/Project ID - Use Scaleway Marketplace API for image lookup instead of broken scaleway_image_info module - Migrate from deprecated 'organization' parameter to modern 'project' parameter in scaleway_compute calls - Add support for SCW_DEFAULT_ORGANIZATION_ID environment variable - Provide clear instructions for finding Organization ID in console Technical details: - Scaleway's default project ID equals the organization ID - Marketplace API is public and doesn't require authentication - The 'project' parameter was added in community.general 4.3.0 Testing: - Added 4 new unit tests validating the fix - All 91 unit tests pass - Passes ansible-lint, yamllint, ruff, and shellcheck 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
Claude finished @dguido's task —— View job PR Review: Scaleway Deployment FixReview Progress
🔍 Overall AssessmentThis is a well-crafted fix that addresses a legitimate issue with broken upstream Ansible modules. The solution is pragmatic and follows established patterns in the Algo codebase. ✅ StrengthsCode Quality
Test Coverage
|
The CodeQL scanner flags domain string assertions as "incomplete URL substring sanitization" but these are test assertions checking that Ansible role files reference the correct URLs, not URL validation logic. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This reverts commit c75a73e.
Summary
Fixes #14846 - Resolves Scaleway deployment failure caused by broken
scaleway_organization_infoAnsible module.Problem
The
scaleway_organization_infomodule from ansible-collections/community.general is broken and returns empty data ([]) when called. This is due to the module using a deprecated API endpoint. See upstream issue: ansible-collections/community.general#3782When users attempted to deploy to Scaleway, they encountered:
This occurred because the role tried to access
scaleway_org.scaleway_organization_info[0]['id']on an empty list.Solution
Instead of relying on the broken Ansible module, this PR:
scaleway_image_infomodule with direct API call to the public Marketplace APIprojectparameter - Updatesscaleway_computecalls to useprojectinstead of deprecatedorganizationparameterSCW_DEFAULT_ORGANIZATION_IDto skip the promptTechnical Details
api-marketplace.scaleway.com) is public and doesn't require authenticationprojectparameter was added toscaleway_computein community.general 4.3.0Changes
Modified Files
roles/cloud-scaleway/tasks/prompts.yml- Added organization/project ID promptroles/cloud-scaleway/tasks/main.yml- Removed broken modules, added Marketplace API lookup, updated to useprojectparametertests/unit/test_scaleway_fix.py- Added 4 new unit testsTesting
Unit Tests:
projectparameter usage, Marketplace API integration, organization ID collectionLinting:
Limitations
How to Test
To test this fix:
./algoand select Scaleway as the providerAlternatively, set environment variables:
Related Issues