# Import gi - Fedora linux-system-roles.network

**URL:** <https://forum.ansible.com/t/import-gi-fedora-linux-system-roles-network/9841>\
**Category:** Get Help\
**Tags:** fedora, aws, awx, collections, galaxy-ng\
**Created:** [October 7, 2024, 6:22pm UTC](https://forum.ansible.com/t/import-gi-fedora-linux-system-roles-network/9841 "2024-10-07T18:22:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![XakV](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/xakv/32/896_2.png) [@XakV](https://forum.ansible.com/u/XakV)\
**Post date:** [October 7, 2024, 6:22pm UTC](https://forum.ansible.com/t/import-gi-fedora-linux-system-roles-network/9841/1 "2024-10-07T18:22:57Z")

</div>

Error from AWX is driving me crazy.  
The error occurs here.

```auto
TASK [fedora.linux_system_roles.network : Configure networking connection profiles] ***
task path: /usr/share/ansible/collections/ansible_collections/fedora/linux_system_roles/roles/network/tasks/main.yml:159
The full traceback is:

```

The last line of the traceback points to this →

```auto
"exception: Traceback (most recent call last):\n File \"/tmp/ansible_fedora.linux_system_roles.network_connections_payload_s7jm1p6r/ansible_fedora.linux_system_roles.network_connections_payload.zip/ansible_collections/fedora/linux_system_roles/plugins/modules/network_connections.py\", line 2853, in main\n File \"/tmp/ansible_fedora.linux_system_roles.network_connections_payload_s7jm1p6r/ansible_fedora.linux_system_roles.network_connections_payload.zip/ansible_collections/fedora/linux_system_roles/plugins/modules/network_connections.py\", line 2079, in run\n File \"/tmp/ansible_fedora.linux_system_roles.network_connections_payload_s7jm1p6r/ansible_fedora.linux_system_roles.network_connections_payload.zip/ansible_collections/fedora/linux_system_roles/plugins/module_utils/network_lsr/argument_validator.py\", line 2535, in validate_connection_one\n if not hasattr(Util.NM(), \"SETTING_IP6_CONFIG_METHOD_DISABLED\"):\n ^^^^^^^^^\n File \"/tmp/ansible_fedora.linux_system_roles.network_connections_payload_s7jm1p6r/ansible_fedora.linux_system_roles.network_connections_payload.zip/ansible_collections/fedora/linux_system_roles/plugins/module_utils/network_lsr/utils.py\", line 68, in NM\n import gi\nModuleNotFoundError: No module named 'gi'\n"

```

I can exec a shell in the ee image, run python3.11 in the shell, and import the gi module. What is causing this problem?

Ansible info

```auto
[root@b2c6b13514f4 runner]# ansible --version
ansible [core 2.17.4]
  config file = None
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.11/site-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.11.10 (main, Sep 9 2024, 00:00:00) [GCC 14.2.1 20240801 (Red Hat 14.2.1-1)] (/usr/bin/python3.11)
  jinja version = 3.1.4
  libyaml = True

```

Collection info ( abbreviated )

```auto
# /usr/local/lib/python3.11/site-packages/ansible_collections
Collection Version
---------------------------------------- -------
amazon.aws 8.2.1
ansible.netcommon 6.1.3
ansible.posix 1.5.4
ansible.utils 4.1.

# /usr/share/ansible/collections/ansible_collections
Collection Version
---------------------------------------- -------
fedora.linux_system_roles 1.88.9

```

The base image is defined as

```auto
version: 3

images:
  base_image:
    name: registry.fedoraproject.org/fedora:40

```

and

```auto
dependencies:
  ansible_core:
    package_pip: ansible
  ansible_runner:
    package_pip: ansible-runner
  python_interpreter:
    package_system: "python3.11"
    python_path: "/usr/bin/python3.11"
  galaxy: requirements.yml
  python: requirements.txt
  system:
    - python3.11-devel [platform:rpm]
    - adcli [platform:rpm]
    - gcc [platform:rpm]
    - cmake [platform:rpm]
    - cairo-devel [platform:rpm]
    - git-core [platform:rpm]
    - git-lfs [platform:rpm]
    - krb5-devel [platform:rpm compile]
    - krb5-workstation [platform:rpm]
    - libcurl-devel [platform:rpm compile]
    - python3.11-devel [platform:rpm compile]
    - rsync [platform:rpm]
    - sshpass [platform:rpm]
    - subversion [platform:dpkg]
    - subversion [platform:rpm]
    - unzip [platform:rpm]
    - python3-gobject [platform:rpm]
    - python3-pexpect [platform:rpm]
    - python3-cairo [platform:rpm]
    - openldap-clients [platform:rpm]
    - gobject-introspection [platform:rpm]
    - gobject-introspection-devel [platform:rpm]
    - cairo-gobject-devel [platform:rpm]
    - pkg-config [platform:rpm]

```

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [October 7, 2024, 6:52pm UTC](https://forum.ansible.com/t/import-gi-fedora-linux-system-roles-network/9841/2 "2024-10-07T18:52:25Z")

</div>

`gi` isn’t needed in the EE, it’s needed on the target host being configured.

---

<div class="post-metadata">

**Author:** ![XakV](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/xakv/32/896_2.png) [@XakV](https://forum.ansible.com/u/XakV)\
**Post date:** [October 7, 2024, 8:01pm UTC](https://forum.ansible.com/t/import-gi-fedora-linux-system-roles-network/9841/3 "2024-10-07T20:01:38Z")

</div>

Thanks for the response. Sorry for the dumb question, but what part of the error gave that away for you?

It **really** looks like it’s complaining about the module in the collection?

The python interpreter is set to auto in the ansible config. We don’t set up python3.11 on our RHEL 8 hosts. I guess we need to set alternatives for python3 to point to 3.11 on the RHEL 9 systems?

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [October 7, 2024, 9:22pm UTC](https://forum.ansible.com/t/import-gi-fedora-linux-system-roles-network/9841/4 "2024-10-07T21:22:17Z")

</div>

Modules, specifically those that configure things, are rarely used in the context of targeting the EE because that isn’t useful. The deps for those modules are required on the target system, since that is where the module actually executes. This is just a description of the standard model of execution of modules.

You may or may not want to target python3.11 on RHEL9 because likely the deps for the modules from the linux\_system\_roles, are likely not published for anything other than the default system python of 3.9.

---

<div class="post-metadata">

**Author:** ![XakV](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/xakv/32/896_2.png) [@XakV](https://forum.ansible.com/u/XakV)\
**Post date:** [October 8, 2024, 3:00am UTC](https://forum.ansible.com/t/import-gi-fedora-linux-system-roles-network/9841/5 "2024-10-08T03:00:20Z")

</div>

Well, again, thanks for the explanation. I’m still re-reading your explanation and going back to basic docs to try and adjust my mental model of what’s happening sorted out. I’ve been using Ansible for eight or nine? years now and have not had to re-evaluate or dig this deeply into the basics to figure out what has always ‘just worked’.
