Again some playbook issue in AWX 23.0.0 while all playbook are running smoothly in AWX 9.0 version
It seems that the network related modules are missing in AWX 23.0.0 version, my playbook is running against Extreme SLX switch
Errors are as below
ERROR! couldn't resolve module/action 'slxos_command'. This often indicates a misspelling, missing collection, or incorrect module path.
The error appears to be in '/runner/project/playbooks/platform/show_version.yml': line 10, column 11, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
- block:
- name: show version [SLX]
^ here
So it seems that I need to install this module below to make it work
But anyone can recommend any documentation or procedure to guide me through the procedure
Parsed /runner/inventory/hosts inventory source with script plugin
redirecting (type: modules) ansible.builtin.slxos_command to community.network.slxos_command**
ERROR! couldn't resolve module/action 'slxos_command'. This often indicates a misspelling, missing collection, or incorrect module path.
My playbooks source code is below
name: Show version
hosts: PE
gather_facts: no
collections:
- community.network
tasks:
- name: Run show version on remote devices
slxos_command:
commands: show version
when:
- (inventory_hostname in groups['SLX'])
changed_when: false
ignore_errors: true
no_log: true
register: output_slx
- name: Results [SLX]
debug:
msg: "{{ output_slx.stdout_lines[0] }}"
when: output_slx.stdout_lines[0] is defined
Hi @mapleos1123, glad to see you are finding the forum useful!
Let me share a couple of tips on using the forum to make it easier for people to help out:
I just edited your messages to include the code blocks for the playbook section, this makes it easier to read as it keeps the playbook format and spacing.
When composing your next messages, you can select the playbook section of text you copy/pasted and use the </> button in the tool-bar right at the top of the message window where you are typing, this will automatically put it in the box you see in the messages above. Here is a screen capture of me doing it for your message above:
And if you get to a point where you consider a post by someone helped to solve the issue, please tick the check-box below their message to mark it as the solution to help other users find the reply faster!
Does the collection appear when you search for it like this?
ansible-galaxy collection list | grep community.network
community.network 5.0.0
Do you get the same error if you use a fully qualified module name, community.network.slxos_command like this?
name: Show version
hosts: PE
gather_facts: no
collections:
- community.network
tasks:
- name: Run show version on remote devices
community.network.slxos_command:
commands: show version
when:
- (inventory_hostname in groups['SLX'])
changed_when: false
ignore_errors: true
no_log: true
register: output_slx
- name: Results [SLX]
debug:
msg: "{{ output_slx.stdout_lines[0] }}"
when: output_slx.stdout_lines[0] is defined
@mapleos1123
If your project is stored on SCM (Git or SubVersion), create collections/requirements.yml on project root and add following content, then sync project on AWX. This will download and install specified collections during project sync:
---
collections:
- name: community.network
If your project type is Manual, adding collections/requirements.yml does not help. In this case, you should create your own custom container image by Ansible Builder. I have a guide for this topic: https://github.com/kurokobo/awx-on-k3s/tree/main/builder
So EE is exactly where collections have to be placed. Adding collections/requirements.yml on your project makes collections to be transferred to EE with your playbook, and building custom EE is the way to make collections available on EE without transfferring it.