# Unexpected playbook error "msg": "the connection plugin 'network\_cli' was not found"

**URL:** <https://forum.ansible.com/t/unexpected-playbook-error-msg-the-connection-plugin-network-cli-was-not-found/2389>\
**Category:** Get Help\
**Tags:** ssl, collections, galaxy-ng\
**Created:** [November 15, 2023, 2:11am UTC](https://forum.ansible.com/t/unexpected-playbook-error-msg-the-connection-plugin-network-cli-was-not-found/2389 "2023-11-15T02:11:48Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![bacchus21](https://avatars.discourse-cdn.com/v4/letter/b/bbe5ce/32.png) [@bacchus21](https://forum.ansible.com/u/bacchus21)\
**Post date:** [November 15, 2023, 2:11am UTC](https://forum.ansible.com/t/unexpected-playbook-error-msg-the-connection-plugin-network-cli-was-not-found/2389/1 "2023-11-15T02:11:48Z")

</div>

Hello, All

I’m getting the following errors while I was running a playbook. It used to be working fine before. However, the old server was broken and, we built a new server. Not sure it’s because of ansible version, but keep getting these error for all playbooks. The current ansible version is ansible [core 2.14.2]

`[root@ansible002 inventories]# ansible ios -i $ANSPATH/inventories/inv-test-simple_for_testing.yml -m ping`  
`OOOOO-XXX-SW01 | FAILED! => {`  
` "msg": "the connection plugin 'network_cli' was not found"`  
`}`  
`[root@ansible002 inventories]#`

- my code!  
`all:`  
` children:`  
` ios:`  
` vars:`  
` ansible_network_os: ios`  
` ansible_connection: network_cli`  
` hosts:`  
` OOOOO-XXX-SW01:`

And there were some feedback that `network_cli` became part of the `ansible.netcommon` collection. Is installing ansible-galaxy the only solution to resolve this issue?

Actually, I tried to install ansible.netcommon collection, but keep getting the following error. Does anyone have any clue?

`[root@ansible002 ~]$ ansible-galaxy collection install ansible.netcommon --force Starting galaxy collection install process`  
`Process install dependency map`  
`[WARNING]: Skipping Galaxy server https://galaxy.ansible.com. Got an unexpected error when getting available versions of collection ansible.netcommon: Unknown error when attempting to call Galaxy at 'https://galaxy.ansible.com/api/': <urlopen error TLS/SSL connection has been closed (EOF) (_ssl.c:992)>`  
`ERROR! Unknown error when attempting to call Galaxy at 'https://galaxy.ansible.com/api/': <urlopen error TLS/SSL connection has been closed (EOF) (_ssl.c:992)>`  
`[root@ansible002 ~]$`

---

<div class="post-metadata">

**Author:** ![jbericat](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jbericat/32/627_2.png) [@jbericat](https://forum.ansible.com/u/jbericat)\
**Post date:** [November 15, 2023, 10:43am UTC](https://forum.ansible.com/t/unexpected-playbook-error-msg-the-connection-plugin-network-cli-was-not-found/2389/2 "2023-11-15T10:43:35Z")

</div>

Hello @bacchus21 welcome to the community!

You’re quite right; the installation of the `ansible.netcommon` collection is needed to use the `network_cli` plugin. I was able to somehow replicate your scenario (but I don’t have an ios device available right now, so I just can’t test it 100%). Anyway, I’m sharing my exec log with you:

```bash
(ansible_ve) [11:34:01] jbericat@control_node:~/DEV/repos/personal/ansible-forum$ ansible ios -i inventory/ -m ping --user root --ask-pass
SSH password: 
dns | FAILED! => {
    "msg": "the connection plugin 'ansible.netcommon.network_cli' was not found"
}
(ansible_ve) [11:35:28] jbericat@control_node:~/DEV/repos/personal/ansible-forum$ ansible-galaxy collection install ansible.netcommon
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/ansible-netcommon-5.3.0.tar.gz to /home/jbericat/.ansible/tmp/ansible-local-29248cg1dfomc/tmp422gzlm3/ansible-netcommon-5.3.0-7tfrcp_f
Installing 'ansible.netcommon:5.3.0' to '/home/jbericat/DEV/repos/personal/ansible-forum/"/home/jbericat/.ansible/collections/ansible_collections/ansible/netcommon'
Downloading https://galaxy.ansible.com/api/v3/plugin/ansible/content/published/collections/artifacts/ansible-utils-2.11.0.tar.gz to /home/jbericat/.ansible/tmp/ansible-local-29248cg1dfomc/tmp422gzlm3/ansible-utils-2.11.0-0a_fw5z5
ansible.netcommon:5.3.0 was installed successfully
Installing 'ansible.utils:2.11.0' to '/home/jbericat/DEV/repos/personal/ansible-forum/"/home/jbericat/.ansible/collections/ansible_collections/ansible/utils'
ansible.utils:2.11.0 was installed successfully
(ansible_ve) [11:35:53] jbericat@control_node:~/DEV/repos/personal/ansible-forum$ ansible ios -i inventory/ -m ping --user root --ask-pass
SSH password: 
dns | FAILED! => {
    "msg": "network os ios is not supported"
}
(ansible_ve) [11:36:02] jbericat@control_node:~/DEV/repos/personal/ansible-forum$ 

```

So, it seems that the root of your problem is that ssl error you got when installing the collection. If you have some kind of a rush, you could [download it manually from Galaxy](https://galaxy.ansible.com/ui/repo/published/ansible/netcommon/) and install from the tar.gz, like this:

```bash
ansible-galaxy collection install ansible-netcommon-5.3.0.tar.gz

```

Meanwhile, I will try to remember how I did troubleshoot this very same `ansible-galaxy` error (it happened to me before).

Cheers!

---

<div class="post-metadata">

**Author:** ![jbericat](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jbericat/32/627_2.png) [@jbericat](https://forum.ansible.com/u/jbericat)\
**Post date:** [November 15, 2023, 11:19am UTC](https://forum.ansible.com/t/unexpected-playbook-error-msg-the-connection-plugin-network-cli-was-not-found/2389/3 "2023-11-15T11:19:26Z")

</div>

found it, that’s how I believe I fixed it:

```bash
sudo update-ca-certificates --fresh
export SSL_CERT_DIR=/etc/ssl/certs

```

> <https://stackoverflow.com/questions/63534262/how-to-fix-following-ansible-galaxy-ssl-error>

You can also try disabling tls certs on ansible.cfg (that is not something I’d do in production, but just for debugging sake):

[https://docs.ansible.com/ansible/latest/reference\_appendices/config.html#galaxy-ignore-certs](https://docs.ansible.com/ansible/latest/reference_appendices/config.html#galaxy-ignore-certs)

Anyway, there could be many other reasons for it to fail… For example, I’ve also seen similar behaviour when running ansible tasks against https nodes from a docker container (EE) that was behind a layer 7 firewall.

See if that helps…

cheers!

---

<div class="post-metadata">

**Author:** ![bacchus21](https://avatars.discourse-cdn.com/v4/letter/b/bbe5ce/32.png) [@bacchus21](https://forum.ansible.com/u/bacchus21)\
**Post date:** [November 16, 2023, 7:15am UTC](https://forum.ansible.com/t/unexpected-playbook-error-msg-the-connection-plugin-network-cli-was-not-found/2389/4 "2023-11-16T07:15:44Z")

</div>

Thank you very much for your comments and support. I also tried to install ansible-galaxy collection manually. But still having the same (\_ssl.c:992)\> error.

`[root@ansible002 ~]# ansible-galaxy collection install ansible-netcommon-5.3.0.tar.gz`  
`Starting galaxy collection install process`  
`Process install dependency map`  
`[WARNING]: Skipping Galaxy server https://galaxy.ansible.com. Got an unexpected error when getting available versions of collection ansible.utils: Unknown error when attempting to call Galaxy at 'https://galaxy.ansible.com/api/': <urlopen error TLS/SSL connection has been closed (EOF) (_ssl.c:992)>`  
`ERROR! Unknown error when attempting to call Galaxy at 'https://galaxy.ansible.com/api/': <urlopen error TLS/SSL connection has been closed (EOF) (_ssl.c:992)>`  
`[root@ansible002 ~]#`

---

<div class="post-metadata">

**Author:** ![bacchus21](https://avatars.discourse-cdn.com/v4/letter/b/bbe5ce/32.png) [@bacchus21](https://forum.ansible.com/u/bacchus21)\
**Post date:** [November 16, 2023, 7:20am UTC](https://forum.ansible.com/t/unexpected-playbook-error-msg-the-connection-plugin-network-cli-was-not-found/2389/5 "2023-11-16T07:20:53Z")

</div>

Thank you very much again. Unfortunately, the issue is not resolved yet.

[root@ansible002 ~]# update-ca-certificates --fresh  
-bash: update-ca-certificates: command not found  
[root@ansible002 ~]#

---

<div class="post-metadata">

**Author:** ![jbericat](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jbericat/32/627_2.png) [@jbericat](https://forum.ansible.com/u/jbericat)\
**Post date:** [November 16, 2023, 7:22am UTC](https://forum.ansible.com/t/unexpected-playbook-error-msg-the-connection-plugin-network-cli-was-not-found/2389/6 "2023-11-16T07:22:05Z")

</div>

Oh, that’s a dependency error. I mean, `ansible.netcommon` needs the prior installation of `ansible.utils`, so it’s trying to install it from Galaxy. You can also try to install this one manually. Anyway, that does not fix your problem, it’s just a temporary patch… I’m quite busy today but I’m really interested on this particular issue, so I’ll try to find time to think harder about it.

---

<div class="post-metadata">

**Author:** ![jbericat](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jbericat/32/627_2.png) [@jbericat](https://forum.ansible.com/u/jbericat)\
**Post date:** [November 16, 2023, 7:30am UTC](https://forum.ansible.com/t/unexpected-playbook-error-msg-the-connection-plugin-network-cli-was-not-found/2389/8 "2023-11-16T07:30:33Z")

</div>

Hello again,

Try installing openssl first please

---

<div class="post-metadata">

**Author:** ![bacchus21](https://avatars.discourse-cdn.com/v4/letter/b/bbe5ce/32.png) [@bacchus21](https://forum.ansible.com/u/bacchus21)\
**Post date:** [November 16, 2023, 7:50am UTC](https://forum.ansible.com/t/unexpected-playbook-error-msg-the-connection-plugin-network-cli-was-not-found/2389/9 "2023-11-16T07:50:03Z")

</div>

Thank you very much for your advice, but openssl is already installed.

`[root@ansible002 ~]# openssl version -a`  
`OpenSSL 3.0.7 1 Nov 2022 (Library: OpenSSL 3.0.7 1 Nov 2022)`  
`built on: Thu Jul 13 00:00:00 2023 UTC`  
`platform: linux-x86_64`  
`options: bn(64,64)`  
`compiler: gcc -fPIC -pthread -m64 -Wa,--noexecstack -Wall -O3 -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -Wa,--noexecstack -Wa,--generate-missing-build-notes=yes -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_PIC -DOPENSSL_BUILDING_OPENSSL -DZLIB -DNDEBUG -DPURIFY -DDEVRANDOM="\"/dev/urandom\"" -DREDHAT_FIPS_VERSION="\"3.0.7-38f89367593abbfc\"" -DSYSTEM_CIPHERS_FILE="/etc/crypto-policies/back-ends/openssl.config"`  
`OPENSSLDIR: "/etc/pki/tls"`  
`ENGINESDIR: "/usr/lib64/engines-3"`  
`MODULESDIR: "/usr/lib64/ossl-modules"`  
`Seeding source: os-specific`  
`CPUINFO: OPENSSL_ia32cap=0xfeda32034f8bffff:0xd09e2fb9`  
`[root@ansible002 ~]#`

---

<div class="post-metadata">

**Author:** ![jbericat](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jbericat/32/627_2.png) [@jbericat](https://forum.ansible.com/u/jbericat)\
**Post date:** [November 16, 2023, 7:54am UTC](https://forum.ansible.com/t/unexpected-playbook-error-msg-the-connection-plugin-network-cli-was-not-found/2389/10 "2023-11-16T07:54:00Z")

</div>

> [@bacchus21](#):
>
> update-ca-certificates

My mistake sorry, I just double checked, the package you have to install should be this one instead (ubuntu install, just adapt it for your distro):

```auto
sudo apt-get install ca-certificates

```

---

<div class="post-metadata">

**Author:** ![bacchus21](https://avatars.discourse-cdn.com/v4/letter/b/bbe5ce/32.png) [@bacchus21](https://forum.ansible.com/u/bacchus21)\
**Post date:** [November 16, 2023, 7:57am UTC](https://forum.ansible.com/t/unexpected-playbook-error-msg-the-connection-plugin-network-cli-was-not-found/2389/11 "2023-11-16T07:57:18Z")

</div>

Highly appreciated on your help. Yes, I also tried to install ansible.utils but the issue still exists.

`[root@ansible002 ~]# ansible-galaxy collection install ansible.utils`  
`Starting galaxy collection install process`  
`Process install dependency map`  
`[WARNING]: Skipping Galaxy server https://galaxy.ansible.com. Got an unexpected error when getting available versions of collection ansible.utils: Unknown error when attempting to call Galaxy at 'https://galaxy.ansible.com/api/': <urlopen error [Errno 111] Connection refused>`  
`ERROR! Unknown error when attempting to call Galaxy at 'https://galaxy.ansible.com/api/': <urlopen error [Errno 111] Connection refused>`  
`[root@ansible002 ~]#`

---

<div class="post-metadata">

**Author:** ![jbericat](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jbericat/32/627_2.png) [@jbericat](https://forum.ansible.com/u/jbericat)\
**Post date:** [November 16, 2023, 8:00am UTC](https://forum.ansible.com/t/unexpected-playbook-error-msg-the-connection-plugin-network-cli-was-not-found/2389/12 "2023-11-16T08:00:55Z")

</div>

> [@bacchus21](#):
>
> nsible-galaxy collection install ansible.utils

No but the idea here was to [download the collection](https://galaxy.ansible.com/ui/repo/published/ansible/utils/) and install it manually using the tar.gz, like you did in previous posts

---

<div class="post-metadata">

**Author:** ![bacchus21](https://avatars.discourse-cdn.com/v4/letter/b/bbe5ce/32.png) [@bacchus21](https://forum.ansible.com/u/bacchus21)\
**Post date:** [November 16, 2023, 9:07am UTC](https://forum.ansible.com/t/unexpected-playbook-error-msg-the-connection-plugin-network-cli-was-not-found/2389/13 "2023-11-16T09:07:19Z")

</div>

Thank you very much for your advice. Highly Highly appreciated!!! Now things are OK. Looks like all the issues were related with dependencies.

`[root@ansible002 ansible_collections]# ansible-galaxy collection install ansible-utils-2.11.0.tar.gz`  
`Starting galaxy collection install process`  
`Process install dependency map`  
`Starting collection install process`  
`Installing 'ansible.utils:2.11.0' to '/root/.ansible/collections/ansible_collections/ansible/utils' ansible.utils:2.11.0 was installed successfully`  
`[root@ansible002 ansible_collections]#`

`[root@ansible002 ansible_collections]# ansible-galaxy collection install ansible-netcommon-5.3.0.tar.gz`  
`Starting galaxy collection install process`  
`Process install dependency map`  
`Starting collection install process`  
`Installing 'ansible.netcommon:5.3.0' to '/root/.ansible/collections/ansible_collections/ansible/netcommon' ansible.netcommon:5.3.0 was installed successfully`  
`'ansible.utils:2.11.0' is already installed, skipping.`  
`[root@ansible002 ansible_collections]#`  
`[root@ansible002 ansible]# ansible-galaxy collection list`

`# /root/.ansible/collections/ansible_collections`  
`Collection Version`  
`----------------- -------`  
`ansible.netcommon 5.3.0`  
`ansible.utils 2.11.0`  
`[root@ansible002 ansible]#`

I will ask many questions from now on other topics, so let’s discuss a lot. Thank you again. Cheers!!!

---

<div class="post-metadata">

**Author:** ![jbericat](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jbericat/32/627_2.png) [@jbericat](https://forum.ansible.com/u/jbericat)\
**Post date:** [November 16, 2023, 9:50am UTC](https://forum.ansible.com/t/unexpected-playbook-error-msg-the-connection-plugin-network-cli-was-not-found/2389/14 "2023-11-16T09:50:53Z")

</div>

Excellent @bacchus21 so glad we could workaorund it.

If you think one of my posts helped you to fix the issue, could you tick the appropriate solved checkbox, please? This way other people will find the best solution faster 😉

> [@bacchus21](#):
>
> I will ask many questions from now on other topics, so let’s discuss a lot.

Looking forward to it! see you around mate 🙂

**EDIT:** Also, if you end-up trying the `update-ca-certificates --fresh` thing, I’d really want to know if that fixes the problem with the `ansible-galaxy` downloads from CLI. Thank you!

---

<div class="post-metadata">

**Author:** ![bacchus21](https://avatars.discourse-cdn.com/v4/letter/b/bbe5ce/32.png) [@bacchus21](https://forum.ansible.com/u/bacchus21)\
**Post date:** [November 17, 2023, 1:16am UTC](https://forum.ansible.com/t/unexpected-playbook-error-msg-the-connection-plugin-network-cli-was-not-found/2389/15 "2023-11-17T01:16:36Z")

</div>

Actually, `update-ca-certificates --fresh` didn’t work for me.  
`[root@ansible002 ~]# update-ca-certificates --fresh`  
`-bash: update-ca-certificates: command not found`  
`[root@ansible002 ~]#`

---

<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:** [December 17, 2023, 1:16am UTC](https://forum.ansible.com/t/unexpected-playbook-error-msg-the-connection-plugin-network-cli-was-not-found/2389/16 "2023-12-17T01:16:51Z")

</div>

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