linode / linode/ansible_linode

[Bug]: region_list does not with with an ID filter as in the docs

Open
#557 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
63
Forks
38
Avg merge
5d 20h
Merged PRs (30d)
7

Description

Ansible Version

ansible [core 2.13.10]

Ansible Configuration

No response

Effected Components

region_list

Expected Behavior

Should have filtered to return a specific region by id

Actual Behavior

Errors that id is not a valid filter

Steps to Reproduce

Sample task:

    - name: Get region information
      linode.cloud.region_list:
        api_token: "{{ linode.api_token }}"
        filters:
          - name: id
            values: us-east
      register: region_result

fails with:

fatal: [localhost]: FAILED! => {
    "changed": false,
    "invocation": {
        "module_args": {
            "api_token": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "api_url": "https://api.linode.com/",
            "api_version": "v4",
            "ca_path": null,
            "count": null,
            "filters": [
                {
                    "name": "id",
                    "values": [
                        "us-east"
                    ]
                }
            ],
            "label": null,
            "order": "asc",
            "order_by": null,
            "state": null,
            "tags": null,
            "ua_prefix": null
        }
    },
    "msg": "Error from Linode API: [400] Cannot filter on id"
}

Although this example comes directly from:

https://github.com/linode/ansible_linode/blob/dev/docs/modules/region_list.md

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the region_list module and the linked docs/modules/region_list.md example, then reproduce the task against the stated Ansible core version. Check how the id filter is defined and passed to the Linode API; done means the documented filter works for us-east and coverage or documentation reflects the supported behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.