# Community.general.nmcli FAILED on RHEL8, works on RHEL9

**URL:** <https://forum.ansible.com/t/community-general-nmcli-failed-on-rhel8-works-on-rhel9/713>\
**Category:** Get Help\
**Tags:** rhel, playbook, network\
**Created:** [September 14, 2023, 10:00am UTC](https://forum.ansible.com/t/community-general-nmcli-failed-on-rhel8-works-on-rhel9/713 "2023-09-14T10:00:15Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nesbit7](https://avatars.discourse-cdn.com/v4/letter/n/53a042/32.png) [@Nesbit7](https://forum.ansible.com/u/Nesbit7)\
**Post date:** [September 14, 2023, 10:00am UTC](https://forum.ansible.com/t/community-general-nmcli-failed-on-rhel8-works-on-rhel9/713/1 "2023-09-14T10:00:15Z")

</div>

I have this snippet:-

```yaml
- name: nmcli eth0 ipv4 dns-search "subdomain.domain.tld"
    community.general.nmcli:
      conn_name: eth0
      dns4_search: subdomain.domain.tld
      state: present

```

which works find on my RHEL9 target client, but the RHEL8 target client reports:-

```plaintext
fatal: [hostname]: FAILED! => {"changed": false, "msg": "Error: bad connection type: 'None' not among [6lowpan, 802-11-olpc-mesh (olpc-mesh), 802-11-wireless (wifi), 802-3-ethernet (ethernet), adsl, bluetooth, bond, bridge, cdma, dummy, generic, gsm, infiniband, ip-tunnel, macsec, macvlan, ovs-bridge, ovs-dpdk, ovs-interface, ovs-patch, ovs-port, pppoe, team, tun, veth, vlan, vpn, vrf, vxlan, wifi-p2p, wimax, wireguard, wpan, bond-slave, bridge-slave, team-slave]\n", "name": "eth0", "rc": 2}

```

eth0 is present, and I can configure the ipv4 dns-search manually on the target machine OK.

I have destroyed and redeployed the target VM but still the same.

any ideas, similar experiences and solutions ?

[dunno why, but the indents have been lost on my snippet, the lines 3-5 should be further indented but have been lost in the paste and I can’t manually indent them here, but indents are there in my yaml]

---

<div class="post-metadata">

**Author:** ![ptn](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/ptn/32/481_2.png) [@ptn](https://forum.ansible.com/u/ptn)\
**Post date:** [September 14, 2023, 10:43am UTC](https://forum.ansible.com/t/community-general-nmcli-failed-on-rhel8-works-on-rhel9/713/2 "2023-09-14T10:43:25Z")

</div>

Hi,

I ran your snippet task on various machines (Debian12, EL8, EL9) using Network Manager and result is the same: [type parameter](https://docs.ansible.com/ansible/latest/collections/community/general/nmcli_module.html#parameter-type) have to be specified if iface doesn’t exist, and I’m guessing that could be your issue ?

> [dunno why, but the indents have been lost on my snippet, the lines 3-5 should be further indented but have been lost in the paste and I can’t manually indent them here, but indents are there in my yaml]

AFAIK discourse posts uses markdown so you’d better use [code blocks](https://www.markdownguide.org/extended-syntax/#fenced-code-blocks) to preserve indentation and such.

Edit: Also pure html and BBCode.

---

<div class="post-metadata">

**Author:** ![gwmngilfen](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/gwmngilfen/32/6_2.png) [@gwmngilfen](https://forum.ansible.com/u/gwmngilfen)\
**Post date:** [September 14, 2023, 11:17am UTC](https://forum.ansible.com/t/community-general-nmcli-failed-on-rhel8-works-on-rhel9/713/3 "2023-09-14T11:17:55Z")

</div>

> [@ptn](#):
>
> AFAIK discourse posts uses markdown so you’d better use [code blocks](https://www.markdownguide.org/extended-syntax/#fenced-code-blocks) to preserve indentation and such.

Indeed! I have edited your post (hope you don’t mind!) to add the necessary backticks ``` around the yaml and the log line. Hope that helps!

---

<div class="post-metadata">

**Author:** ![Nesbit7](https://avatars.discourse-cdn.com/v4/letter/n/53a042/32.png) [@Nesbit7](https://forum.ansible.com/u/Nesbit7)\
**Post date:** [September 14, 2023, 12:22pm UTC](https://forum.ansible.com/t/community-general-nmcli-failed-on-rhel8-works-on-rhel9/713/4 "2023-09-14T12:22:53Z")

</div>

thanks, Greg, will know for next time, thanks for the update,

---

<div class="post-metadata">

**Author:** ![Nesbit7](https://avatars.discourse-cdn.com/v4/letter/n/53a042/32.png) [@Nesbit7](https://forum.ansible.com/u/Nesbit7)\
**Post date:** [September 14, 2023, 1:33pm UTC](https://forum.ansible.com/t/community-general-nmcli-failed-on-rhel8-works-on-rhel9/713/5 "2023-09-14T13:33:55Z")

</div>

yowza, there’s some nice people out there,  
great spot, Pierre, you were spot on  
type has been specified and confirmed as working as expected now.  
[musta been some default improvements in EL9 to accept type unspecified that aren’t there in EL8]  
once again, thanks,

---

<div class="post-metadata">

**Author:** ![gwmngilfen](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/gwmngilfen/32/6_2.png) [@gwmngilfen](https://forum.ansible.com/u/gwmngilfen)\
**Post date:** [September 14, 2023, 1:50pm UTC](https://forum.ansible.com/t/community-general-nmcli-failed-on-rhel8-works-on-rhel9/713/6 "2023-09-14T13:50:19Z")

</div>

Glad it worked @Nesbit7 - if you wouldn’t mind hitting that ✅ to accept @ptn’s answer, that would be lovely 😉

---

<div class="post-metadata">

**Author:** ![Nesbit7](https://avatars.discourse-cdn.com/v4/letter/n/53a042/32.png) [@Nesbit7](https://forum.ansible.com/u/Nesbit7)\
**Post date:** [September 14, 2023, 2:01pm UTC](https://forum.ansible.com/t/community-general-nmcli-failed-on-rhel8-works-on-rhel9/713/7 "2023-09-14T14:01:20Z")

</div>

already done once I realised that button was there, no prob

---

<div class="post-metadata">

**Author:** ![gwmngilfen](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/gwmngilfen/32/6_2.png) [@gwmngilfen](https://forum.ansible.com/u/gwmngilfen)\
**Post date:** [September 14, 2023, 2:24pm UTC](https://forum.ansible.com/t/community-general-nmcli-failed-on-rhel8-works-on-rhel9/713/8 "2023-09-14T14:24:53Z")

</div>

You know, I could have sworn i looked before posted, but clearly I did not look properly. Thanks! Hope you’ll stick around 😉

---

<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 14, 2023, 2:25pm UTC](https://forum.ansible.com/t/community-general-nmcli-failed-on-rhel8-works-on-rhel9/713/9 "2023-10-14T14:25:22Z")

</div>

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

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