I recently provisioned AWX 23.9.0 on k3s.
However, I’m unable to run any tasks in jobs/templates that involve cisco.nxos collection.
Here is the error message I got each time I try to run this job:
<LAB_001> attempting to start connection
<LAB_001> using connection plugin ansible.netcommon.network_cli
Found ansible-connection at path /usr/local/bin/ansible-connection
<LAB_001> found existing local domain socket, using it!
<LAB_001> updating play_context for connection
<LAB_001> Loading collection ansible.builtin from
<LAB_001> local domain socket path is /runner/.ansible/pc/3078c7e19f
<LAB_001> Using network group action cisco.nxos.nxos for cisco.nxos.nxos_command
<LAB_001> ANSIBLE_NETWORK_IMPORT_MODULES: enabled
<LAB_001> ANSIBLE_NETWORK_IMPORT_MODULES: found cisco.nxos.nxos_command at /runner/requirements_collections/ansible_collections/cisco/nxos/plugins/modules/nxos_command.py
<LAB_001> ANSIBLE_NETWORK_IMPORT_MODULES: running cisco.nxos.nxos_command
<LAB_001> ANSIBLE_NETWORK_IMPORT_MODULES: complete
<LAB_001> ANSIBLE_NETWORK_IMPORT_MODULES: Result: {'failed': True, '_ansible_parsed': False, 'module_stdout': '', 'module_stderr': '[Errno -2] Name or service not known', 'msg': 'MODULE FAILURE\nSee stdout/stderr for the exact error'}
fatal: [LAB_001]: FAILED! => {
"changed": false,
"module_stderr": "[Errno -2] Name or service not known",
"module_stdout": "",
"msg": "MODULE FAILURE\nSee stdout/stderr for the exact error"
}
I confirmed that the connection is fine by performing ping test:
---
- name: cisco configuration playbook
hosts: LAB_001
gather_facts: false
tasks:
- name: Print out inventory_hostname
debug:
msg: "inventory_hostname: {{ inventory_hostname }}"
- name: Update setings for specific device names
set_fact:
ansible_user: "admin"
ansible_password: "adminpsw"
ansible_network_os: "cisco.nxos.nxos"
ansible_connection: "ansible.netcommon.network_cli"
when: inventory_hostname in ['LAB_001']
# when: inventory_hostname == "LAB_001"
- name: Perform ping test
ping:
- name: Execute a command on network device
cisco.nxos.nxos_command:
commands:
- show version
collections/requirements.yml:
---
collections:
# - name: ansible.utils # cisco.nxos was dependant on these collections so tried even including them
# - name: ansible.netcommon # cisco.nxos was dependant on these collections so tried even including them
- name: netbox.netbox
- name: cisco.nxos
# version: "5.3.0" # tried even with specify different versions here
- name: community.general
logs of requirements.yml execution:
Starting galaxy collection install process
Process install dependency map
Starting collection install process
Downloading https://galaxy.ansible.com/api/v3/plugin/ansible/content/published/collections/artifacts/netbox-netbox-3.17.0.tar.gz to /var/lib/awx/projects/.__awx_cache/_24__playbooks_061407147_pm/stage/tmp/ansible-local-9940wk6_9asy/tmphhaipwxm/netbox-netbox-3.17.0-x6xafbzu
Installing 'netbox.netbox:3.17.0' to '/var/lib/awx/projects/.__awx_cache/_24__playbooks_061407147_pm/stage/requirements_collections/ansible_collections/netbox/netbox'
netbox.netbox:3.17.0 was installed successfully
Downloading https://galaxy.ansible.com/api/v3/plugin/ansible/content/published/collections/artifacts/cisco-nxos-8.0.0.tar.gz to /var/lib/awx/projects/.__awx_cache/_24__playbooks_061407147_pm/stage/tmp/ansible-local-9940wk6_9asy/tmphhaipwxm/cisco-nxos-8.0.0-symu3pg4
Installing 'cisco.nxos:8.0.0' to '/var/lib/awx/projects/.__awx_cache/_24__playbooks_061407147_pm/stage/requirements_collections/ansible_collections/cisco/nxos'
cisco.nxos:8.0.0 was installed successfully
Downloading https://galaxy.ansible.com/api/v3/plugin/ansible/content/published/collections/artifacts/ansible-netcommon-6.1.1.tar.gz to /var/lib/awx/projects/.__awx_cache/_24__playbooks_061407147_pm/stage/tmp/ansible-local-9940wk6_9asy/tmphhaipwxm/ansible-netcommon-6.1.1-d38xyrsc
Installing 'ansible.netcommon:6.1.1' to '/var/lib/awx/projects/.__awx_cache/_24__playbooks_061407147_pm/stage/requirements_collections/ansible_collections/ansible/netcommon'
ansible.netcommon:6.1.1 was installed successfully
Downloading https://galaxy.ansible.com/api/v3/plugin/ansible/content/published/collections/artifacts/ansible-utils-4.1.0.tar.gz to /var/lib/awx/projects/.__awx_cache/_24__playbooks_061407147_pm/stage/tmp/ansible-local-9940wk6_9asy/tmphhaipwxm/ansible-utils-4.1.0-8opnjr_8
Installing 'ansible.utils:4.1.0' to '/var/lib/awx/projects/.__awx_cache/_24__playbooks_061407147_pm/stage/requirements_collections/ansible_collections/ansible/utils'
ansible.utils:4.1.0 was installed successfully
Downloading https://galaxy.ansible.com/api/v3/plugin/ansible/content/published/collections/artifacts/community-general-8.6.0.tar.gz to /var/lib/awx/projects/.__awx_cache/_24__playbooks_061407147_pm/stage/tmp/ansible-local-9940wk6_9asy/tmphhaipwxm/community-general-8.6.0-db5fkorg
Installing 'community.general:8.6.0' to '/var/lib/awx/projects/.__awx_cache/_24__playbooks_061407147_pm/stage/requirements_collections/ansible_collections/community/general'
community.general:8.6.0 was installed successfully
ansible.cfg:
[persistent_connection]
ssh_type = paramiko
additional playbook run logs:
ansible-playbook [core 2.15.11]
config file = /runner/project/ansible.cfg
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/requirements_collections:/runner/.ansible/collections:/usr/share/ansible/collections
executable location = /usr/local/bin/ansible-playbook
python version = 3.9.18 (main, Jan 24 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
Using /runner/project/ansible.cfg as config file
setting up inventory plugins
Loading collection ansible.builtin from
host_list declined parsing /runner/inventory/hosts as it did not pass its verify_file() method
Parsed /runner/inventory/hosts inventory source with script plugin
Loading collection cisco.nxos from /runner/requirements_collections/ansible_collections/cisco/nxos
Loading callback plugin default of type stdout, v2.0 from /usr/local/lib/python3.9/site-packages/ansible/plugins/callback/default.py
Loading callback plugin awx_display of type stdout, v2.0 from /usr/local/lib/python3.9/site-packages/ansible_runner/display_callback/callback/awx_display.py
Attempting to use 'awx_display' callback.
Skipping callback 'awx_display', as we already have a stdout callback.
Attempting to use 'default' callback.
Skipping callback 'default', as we already have a stdout callback.
Attempting to use 'junit' callback.
Attempting to use 'minimal' callback.
Skipping callback 'minimal', as we already have a stdout callback.
Attempting to use 'oneline' callback.
Skipping callback 'oneline', as we already have a stdout callback.
Attempting to use 'tree' callback.
PLAYBOOK: playbook-all.yml *****************************************************
Positional arguments: playbook-all.yml
verbosity: 5
remote_user: root
connection: smart
timeout: 10
become_method: sudo
tags: ('all',)
inventory: ('/runner/inventory/hosts',)
extra_vars: ('@/runner/env/tmpgg6dvtnd', '@/runner/env/extravars')
forks: 5
2 plays in playbook-all.yml