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]#
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 ~]$
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:
(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 and install from the tar.gz, like this:
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.
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 ~]#
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.
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 ~]#
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
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!
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 ~]#