linode / linode/ansible_linode

[Bug]: ansible-inventory --list generates "reserved name" warning for tags

Open
#744 1 comment 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.20.1]

Ansible Configuration

ALLOW_BROKEN_CONDITIONALS(/Users/me/Projects/ansible/ansible.cfg) = True
ANSIBLE_NOCOLOR(/Users/me/Projects/ansible/ansible.cfg) = True
COLLECTIONS_PATHS(/Users/me/Projects/ansible/ansible.cfg) = ['/Users/me/Projects/ansible']
CONFIG_FILE() = /Users/me/Projects/ansible/ansible.cfg
DEFAULT_FORCE_HANDLERS(/Users/me/Projects/ansible/ansible.cfg) = True
DEFAULT_GATHERING(/Users/me/Projects/ansible/ansible.cfg) = explicit
DEFAULT_HOST_LIST(/Users/me/Projects/ansible/ansible.cfg) = ['/Users/me/Projects/ansible/inventory.test']
DEFAULT_LOAD_CALLBACK_PLUGINS(/Users/me/Projects/ansible/ansible.cfg) = True
DEFAULT_LOG_PATH(/Users/me/Projects/ansible/ansible.cfg) = /Users/me/Projects/ansible/ansible.log
DEFAULT_NO_TARGET_SYSLOG(/Users/me/Projects/ansible/ansible.cfg) = True
DEPRECATION_WARNINGS(/Users/me/Projects/ansible/ansible.cfg) = False
DIFF_ALWAYS(/Users/me/Projects/ansible/ansible.cfg) = True
INJECT_FACTS_AS_VARS(/Users/me/Projects/ansible/ansible.cfg) = False
INTERPRETER_PYTHON(/Users/me/Projects/ansible/ansible.cfg) = auto_silent
INVENTORY_ENABLED(/Users/me/Projects/ansible/ansible.cfg) = ['linode.cloud.instance', 'auto', 'yaml', 'ini']
PERSISTENT_COMMAND_TIMEOUT(/Users/me/Projects/ansible/ansible.cfg) = 60

Effected Components

linode.cloud.instance

Expected Behavior

The simplest dynamic inventory file should work without warnings.

Actual Behavior

With the following minimal inventory file, a warning is generated to stderr by ansible-inventory (and everything else that uses the inventory).

$ ansible-inventory -i inv.linode.yaml --list>/dev/null
[WARNING]: Found variable using reserved name 'tags'.
Origin: <unknown>

tags
Steps to Reproduce

The file inv.linode.yaml is simply:

$ cat inv.linode.yaml 
plugin: linode.cloud.instance
# Filter by tag
api_token: "{{ lookup('env', 'LINODE_CLI_TOKEN') }}"
compose:
  ansible_host: ipv4[0]

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

Reproduce the warning with ansible-inventory --list and the minimal inv.linode.yaml configuration shown. Start at the linode.cloud.instance inventory plugin and trace how the tags value is exposed during inventory loading. Done means the minimal dynamic inventory runs without the reserved-name warning while retaining the expected inventory data.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.