# How to install network related module in AWX version 23.0

**URL:** <https://forum.ansible.com/t/how-to-install-network-related-module-in-awx-version-23-0/1032>\
**Category:** Get Help\
**Tags:** extremeslx, collections, awx, network\
**Created:** [September 22, 2023, 6:55am UTC](https://forum.ansible.com/t/how-to-install-network-related-module-in-awx-version-23-0/1032 "2023-09-22T06:55:03Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![mapleos1123](https://avatars.discourse-cdn.com/v4/letter/m/ed8c4c/32.png) [@mapleos1123](https://forum.ansible.com/u/mapleos1123)\
**Post date:** [September 22, 2023, 6:55am UTC](https://forum.ansible.com/t/how-to-install-network-related-module-in-awx-version-23-0/1032/1 "2023-09-22T06:55:03Z")

</div>

hi guys,

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

```auto
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

[https://galaxy.ansible.com/extreme/slxos](https://galaxy.ansible.com/extreme/slxos)

But anyone can recommend any documentation or procedure to guide me through the procedure

Thanks

---

<div class="post-metadata">

**Author:** ![mapleos1123](https://avatars.discourse-cdn.com/v4/letter/m/ed8c4c/32.png) [@mapleos1123](https://forum.ansible.com/u/mapleos1123)\
**Post date:** [September 22, 2023, 8:39pm UTC](https://forum.ansible.com/t/how-to-install-network-related-module-in-awx-version-23-0/1032/2 "2023-09-22T20:39:34Z")

</div>

[@AWX](https://forum.ansible.com/groups/awx)

I have managed to install this module with the command

`ansible-galaxy collection install community.network`

in awx-operator-controller-manager container,

I think I can even see this module

```auto
bash-4.4$ pwd
/opt/ansible/.ansible/collections/ansible_collections/community/network/plugins/modules

bash-4.4$ ls -al | grep slxos_command
-rw-r--r--. 1 ansible root 7382 Sep 22 20:32 slxos_command.py
bash-4.4$

```

But still when I run this playbook, I have errors

```auto
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

```auto
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

```

---

<div class="post-metadata">

**Author:** ![Leo](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/leo/32/23_2.png) [@Leo](https://forum.ansible.com/u/Leo)\
**Post date:** [September 22, 2023, 9:18pm UTC](https://forum.ansible.com/t/how-to-install-network-related-module-in-awx-version-23-0/1032/3 "2023-09-22T21:18:13Z")

</div>

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:

 ![image](https://us1.discourse-cdn.com/ansible/original/1X/62f345b4d76cfdaf11b07ccf4925319edf657c6d.png)

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!

---

<div class="post-metadata">

**Author:** ![chris](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/chris/32/293_2.png) [@chris](https://forum.ansible.com/u/chris)\
**Post date:** [September 22, 2023, 9:26pm UTC](https://forum.ansible.com/t/how-to-install-network-related-module-in-awx-version-23-0/1032/4 "2023-09-22T21:26:16Z")

</div>

Does the collection appear when you search for it like this?

```bash
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?

```yaml
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

```

---

<div class="post-metadata">

**Author:** ![mapleos1123](https://avatars.discourse-cdn.com/v4/letter/m/ed8c4c/32.png) [@mapleos1123](https://forum.ansible.com/u/mapleos1123)\
**Post date:** [September 23, 2023, 5:52am UTC](https://forum.ansible.com/t/how-to-install-network-related-module-in-awx-version-23-0/1032/5 "2023-09-23T05:52:38Z")

</div>

> [@Leo](#):
>
> 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:

hi @Leo thanks for the useful tip, I will follow the guide 🙂

---

<div class="post-metadata">

**Author:** ![mapleos1123](https://avatars.discourse-cdn.com/v4/letter/m/ed8c4c/32.png) [@mapleos1123](https://forum.ansible.com/u/mapleos1123)\
**Post date:** [September 23, 2023, 6:01am UTC](https://forum.ansible.com/t/how-to-install-network-related-module-in-awx-version-23-0/1032/6 "2023-09-23T06:01:02Z")

</div>

> [@chris](#):
>
> `ansible-galaxy collection list | grep community.network`

hi @chris

Thanks a lot for your time

I did not see ‘list’ option in this command

```auto
bash-4.4$ ansible-galaxy collection list | grep community.network
usage: ansible-galaxy collection [-h] COLLECTION_ACTION ...
ansible-galaxy collection: error: argument COLLECTION_ACTION: invalid choice: 'list' (choose from 'init', 'build', 'publish', 'install')
bash-4.4$

```

I am not sure if I install this collection in a correct way or not. What I did was to log into awx-operator-controller-manager container

```auto
kubectl exec -it awx-operator-controller-manager-65ddfcbf7d-hb49j -n awx

```

and installed with this command

```auto
ansible-galaxy collection install community.network

```

After that command, I can see the path seems contain the package I have installed

```auto
bash-4.4$ pwd
/opt/ansible/.ansible/collections/ansible_collections/community/network

```

Am I installing the collection in a correct way ? Since I did not find in AWX GUI to download/import Ansible collection

And yes, I have tried to use fully qualified module name in the playbook as well, but it the same

---

<div class="post-metadata">

**Author:** ![chris](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/chris/32/293_2.png) [@chris](https://forum.ansible.com/u/chris)\
**Post date:** [September 23, 2023, 8:08am UTC](https://forum.ansible.com/t/how-to-install-network-related-module-in-awx-version-23-0/1032/7 "2023-09-23T08:08:19Z")

</div>

> [@mapleos1123](#):
>
> I did not see ‘list’ option in this command

Perhaps you have an old version that doesn’t support `list`, or perhaps the collection is not installed, what does it return without the `grep`:

```bash
ansible-galaxy collection list

```

You can check the `ansible-galaxy` version like this:

```bash
ansible-galaxy --version 
ansible-galaxy [core 2.15.4]
  config file = /home/chris/.ansible.cfg
  configured module search path = ['/home/chris/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/chris/.local/pipx/venvs/ansible/lib/python3.11/site-packages/ansible
  ansible collection location = /home/chris/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/chris/.local/bin/ansible-galaxy
  python version = 3.11.2 (main, Mar 13 2023, 12:18:29) [GCC 12.2.0] (/home/chris/.local/pipx/venvs/ansible/bin/python)
  jinja version = 3.1.2
  libyaml = True

```

Sorry I know nothing about AWX so can’t help with that, perhaps you could use [Ansible to install the collection](https://docs.ansible.com/ansible/latest/collections/community/general/ansible_galaxy_install_module.html)?

---

<div class="post-metadata">

**Author:** ![kurokobo](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/kurokobo/32/182_2.png) [@kurokobo](https://forum.ansible.com/u/kurokobo)\
**Post date:** [September 23, 2023, 8:37am UTC](https://forum.ansible.com/t/how-to-install-network-related-module-in-awx-version-23-0/1032/8 "2023-09-23T08:37:30Z")

</div>

@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:

```yaml
---
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](https://github.com/kurokobo/awx-on-k3s/tree/main/builder)

**Background** :

In the recent version of AWX, your playbook will launched in isolated container called **Execution Environment**. This is completely different architecture from AWX 9.x, so you should know what EE is: [What's new in Ansible Automation Platform 2: automation execution environments](https://www.ansible.com/blog/whats-new-in-ansible-automation-platform-2-automation-execution-environments)

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.

---

<div class="post-metadata">

**Author:** ![mapleos1123](https://avatars.discourse-cdn.com/v4/letter/m/ed8c4c/32.png) [@mapleos1123](https://forum.ansible.com/u/mapleos1123)\
**Post date:** [September 25, 2023, 2:03pm UTC](https://forum.ansible.com/t/how-to-install-network-related-module-in-awx-version-23-0/1032/9 "2023-09-25T14:03:01Z")

</div>

@kurokobo

Thanks a lot, this works, although I do have some other issues popping up, there is no any missing module related alarm

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [October 25, 2023, 2:03pm UTC](https://forum.ansible.com/t/how-to-install-network-related-module-in-awx-version-23-0/1032/10 "2023-10-25T14:03:11Z")

</div>

Closed on October 25, 2023, 2:03pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
