-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Fix Scaleway deployment by replacing broken organization_info module (fixes #14846) #14848
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
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 <[email protected]>
|
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
|
| assert 'organization: "{{' not in content, "Still using deprecated 'organization' parameter" | ||
|
|
||
| # Should use Marketplace API for image lookup | ||
| assert "api-marketplace.scaleway.com" in content, "Not using Scaleway Marketplace API for image lookup" |
Check failure
Code scanning / CodeQL
Incomplete URL substring sanitization High test
api-marketplace.scaleway.com
Copilot Autofix
AI 11 days ago
Copilot could not generate an autofix suggestion
Copilot could not generate an autofix suggestion for this alert. Try pushing a new commit or if the problem persists contact support.
| ), "Missing support for SCW_DEFAULT_ORGANIZATION_ID environment variable" | ||
|
|
||
| # Should mention console.scaleway.com for finding the ID | ||
| assert "console.scaleway.com" in content, "Missing instructions on where to find Organization ID" |
Check failure
Code scanning / CodeQL
Incomplete URL substring sanitization High test
console.scaleway.com
Copilot Autofix
AI 11 days ago
Copilot could not generate an autofix suggestion
Copilot could not generate an autofix suggestion for this alert. Try pushing a new commit or if the problem persists contact support.
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