You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am encountering an issue with the netbox.netbox.lookup plugin while running playbooks in AWX. The error message indicates that the pynetbox module is not installed, even though pynetbox is installed and visible when running pip list. Interestingly, other NetBox-related modules, such as netbox.netbox.netbox_vm_interface, works without any issues.
I tried logging into the execution environment while the container was running and running python -c "import pynetbox" without errors. I also did a pip list to confirm pynetbox was installed.
First step of my playbook is to install pynetbox into the execution environment:
- name: "Query NetBox for all sites"debug:
msg: > "Device {{ item.value.name }} (ID: {{ item.key }}) was manufactured by {{ item.value.device_type.manufacturer.name }}"loop: "{{ query('netbox.netbox.nb_lookup', 'devices', api_filter='role=firewall', api_endpoint=netbox_url, token=netbox_token)}}"
Playbook task that is working:
- name: Create or update VM in Netboxnetbox.netbox.netbox_vm_interface:
netbox_token: '{{ NETBOX_TOKEN }}'netbox_url: '{{ NETBOX_API }}'data:
virtual_machine: "{{ inventory_hostname }}"name: "{{ item[0] }}"state: presentvalidate_certs: Falseloop: "{{ interfaces_data }}"delegate_to: localhost
Expected Behavior
The netbox.netbox.lookup plugin should successfully detect the pynetbox module, and the playbook should execute without errors like the netbox.netbox.netbox_vm_interface module.
Observed Behavior
Task is failing with the following error:
fatal: [localhost]: FAILED! => {"msg": "The pynetbox python module is required"}
The text was updated successfully, but these errors were encountered:
Ansible NetBox Collection version
v3.20.0
Ansible version
ansible [core 2.15.12]
config file = None
configured module search path = ['/runner/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/local/lib/python3.9/site-packages/ansible
ansible collection location = /runner/.ansible/collections:/usr/share/ansible/collections
executable location = /usr/local/bin/ansible
python version = 3.9.19 (main, Jun 11 2024, 00:00:00) [GCC 11.4.1 20231218 (Red Hat 11.4.1-3)] (/usr/bin/python3)
jinja version = 3.1.4
libyaml = True
NetBox version
v4.0.6
Python version
3.9
Steps to Reproduce
I am encountering an issue with the netbox.netbox.lookup plugin while running playbooks in AWX. The error message indicates that the pynetbox module is not installed, even though pynetbox is installed and visible when running pip list. Interestingly, other NetBox-related modules, such as netbox.netbox.netbox_vm_interface, works without any issues.
I tried logging into the execution environment while the container was running and running python -c "import pynetbox" without errors. I also did a pip list to confirm pynetbox was installed.
First step of my playbook is to install pynetbox into the execution environment:
Playbook task that is failing:
Playbook task that is working:
Expected Behavior
The netbox.netbox.lookup plugin should successfully detect the pynetbox module, and the playbook should execute without errors like the netbox.netbox.netbox_vm_interface module.
Observed Behavior
Task is failing with the following error:
fatal: [localhost]: FAILED! => {"msg": "The pynetbox python module is required"}
The text was updated successfully, but these errors were encountered: