Skip to content

rename_variables is not renaming tags #674

@rrobe53

Description

@rrobe53
ISSUE TYPE
  • Bug Report
SOFTWARE VERSIONS
pynautobot 3.0.0
Ansible: ansible [core 2.19.4]
Nautobot:v2.4.17
Collection: 6.0.0
SUMMARY

Unable to rename_variables to avoid error about tags variable.

STEPS TO REPRODUCE

Create a barebones inventory and receive error:

[WARNING]: Found variable using reserved name 'tags'.
Origin: <unknown>

tags

Attempt to resolve error through variations of pattern: "tags", tags remains set in ansible-inventory --host example

plugin: networktocode.nautobot.inventory
api_endpoint: https://...
validate_certs: true
config_context: true
rename_variables:
  - pattern: "^tags$"
    repl: "nb_tags"
EXPECTED RESULTS

ansible-inventory --host example generates:

{
    "ansible_host": "172.20.20.2",
    "cluster": "Sample Cluster",
    "cluster_type": "Sample Cluster Type",
    "config_context": [
...
    ],
    "custom_fields": {},
    "is_virtual": true,
    "local_context_data": [
        null
    ],
    "location": "...",
    "locations": [
        "..."
    ],
    "manufacturers": [
        "Palo Alto Networks"
    ],
    "platforms": [
        "paloalto_panos"
    ],
    "primary_ip4": "172.20.20.2",
    "services": [],
    "status": {
...
    },
    "nb_tags": []
}
ACTUAL RESULTS

ansible-inventory --host example generates:

{
    "ansible_host": "172.20.20.2",
    "cluster": "Sample Cluster",
    "cluster_type": "Sample Cluster Type",
    "config_context": [
...
    ],
    "custom_fields": {},
    "is_virtual": true,
    "local_context_data": [
        null
    ],
    "location": "...",
    "locations": [
        "..."
    ],
    "manufacturers": [
        "Palo Alto Networks"
    ],
    "platforms": [
        "paloalto_panos"
    ],
    "primary_ip4": "172.20.20.2",
    "services": [],
    "status": {
...
    },
    "tags": []
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions