Skip to content
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

[Bug]: Netbox inventory services data variable name interfere with ansible builtin service_facts #1272

Open
a-haurylau opened this issue Jun 19, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@a-haurylau
Copy link

a-haurylau commented Jun 19, 2024

Ansible NetBox Collection version

v3.17.0

Ansible version

2.15.10

NetBox version

v3.7.8

Python version

3.9

Steps to Reproduce

Just enable fact cache and perform host service data gathering with ansible as stated here https://docs.ansible.com/ansible/latest/collections/ansible/builtin/service_facts_module.html

- name: Gather the service facts
  ansible.builtin.service_facts:

This one stores in fact cache all service data in 'services' dict. But in the same way netbox inventory stores service data from netbox in same 'services' list. So it means that you cannot use fact cache for host services and service data from netbox in same time.

Expected Behavior

Instead of 'services' variable netbox inventory should put data to lets say 'netbox_services' or better, as stated here https://ansible.readthedocs.io/projects/lint/rules/var-naming/ -

var-naming[no-reserved]: Variables names must not be Ansible reserved names.
var-naming[no-role-prefix]: Variables names from within roles should use role_name_ as a prefix. Underlines are accepted before the prefix.

Observed Behavior

'services' dict from fact cache used instead 'services' list from host vars

@a-haurylau a-haurylau added the bug Something isn't working label Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant