ansible-collections / community.general

Ansible Community General Collection
https://galaxy.ansible.com/ui/repo/published/community/general/
GNU General Public License v3.0
810 stars 1.49k forks source link

Scaleway organization list is broken in scaleway_organization_info #3782

Open gromain opened 2 years ago

gromain commented 2 years ago

Summary

scaleway_organization_info does not return an organization list.

When using the URL from the module to create a request (here), we can clearly see that the returned value is empty:

$ curl https://account.scaleway.com/organizations\? -H "X-Auth-Token: xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxxx"
{"organizations": []}%

This issue was revealed by trying to set up Algo (https://github.com/trailofbits/algo/issues/14245).

Current documentation from Scaleway is quite different from this method: https://www.scaleway.com/en/docs/console/my-project/api-cli/retrieving-org-id

Issue Type

Bug Report

Component Name

scaleway_organization_info

Ansible Version

$ ansible --version
ansible [core 2.11.3] 
  config file = /home/rbazile/Documents/admin/VPN/algo/ansible.cfg
  configured module search path = ['/home/rbazile/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/rbazile/.local/lib/python3.9/site-packages/ansible
  ansible collection location = /home/rbazile/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/rbazile/.local/bin/ansible
  python version = 3.9.7 (default, Oct 10 2021, 15:13:22) [GCC 11.1.0]
  jinja version = 3.0.3
  libyaml = True

Community.general Version

$ ansible-galaxy collection list community.general
ansible-galaxy collection list community.general

# /home/rbazile/.local/lib/python3.9/site-packages/ansible_collections
Collection        Version
----------------- -------
community.general 3.5.0

Configuration

$ ansible-config dump --only-changed
ANSIBLE_PIPELINING(/home/rbazile/Documents/admin/VPN/algo/ansible.cfg) = True
DEFAULT_HOST_LIST(/home/rbazile/Documents/admin/VPN/algo/ansible.cfg) = ['/home/rbazile/Documents/admin/VPN/algo/inventory']
DEFAULT_STDOUT_CALLBACK(/home/rbazile/Documents/admin/VPN/algo/ansible.cfg) = default
DEFAULT_TIMEOUT(/home/rbazile/Documents/admin/VPN/algo/ansible.cfg) = 60
DISPLAY_SKIPPED_HOSTS(/home/rbazile/Documents/admin/VPN/algo/ansible.cfg) = False
HOST_KEY_CHECKING(/home/rbazile/Documents/admin/VPN/algo/ansible.cfg) = False
RETRY_FILES_ENABLED(/home/rbazile/Documents/admin/VPN/algo/ansible.cfg) = False
TRANSFORM_INVALID_GROUP_CHARS(/home/rbazile/Documents/admin/VPN/algo/ansible.cfg) = ignore

OS / Environment

Manjaro Linux

Steps to Reproduce

- block:
  - name: Gather Scaleway organizations facts
    scaleway_organization_info:
    register: scaleway_org

  - name: organization
    debug:
      msg: "{{ scaleway_org }}"

Don't forget to set the api token with 'SCW_TOKEN', 'SCW_API_KEY', 'SCW_OAUTH_TOKEN' or 'SCW_API_TOKEN' environment variable.

Expected Results

I expected the organization list to be returned.

Actual Results

TASK [cloud-scaleway : Gather Scaleway organizations facts] ***********************************************************************************************************************
[WARNING]: https://account.scaleway.com/organizations?
ok: [localhost]

TASK [cloud-scaleway : organization] **********************************************************************************************************************************************
ok: [localhost] => {
    "msg": {
        "changed": false,
        "failed": false,
        "scaleway_organization_info": [],
        "warnings": [
            "https://account.scaleway.com/organizations?"
        ]
    }
}

Code of Conduct

ansibullbot commented 2 years ago

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help

ansibullbot commented 2 years ago

cc @QuentinBrosse @Spredzy @abarbare @jerome-quere @kindermoumoute @remyleone @sieben click here for bot help

ansibullbot commented 1 year ago

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help