Hello everyone
Rocky Linux 9.4
ansible [core 2.15.12]
I’m trying to use connection module: ansible.netcommon.cli_command but I get this error:
fatal: [10.84.0.201]: FAILED! => {“msg”: “network os ansible.netcommon.cli_command is not supported”}
I have a file with variables located in /etc/ansible/group_vars/switches.yml
that looks like this:
ansible_user: admin
ansible_password:
ansible_network_os: ansible.netcommon.cli_command
ansible_connection: network_cli
ansible_become: yes
ansible_become_method: enable
ansible_become_password: my_enable_password
My playbook:
-
name: Retrieve Dell OS6 switch OS version
hosts: switches
gather_facts: no # Disable gathering facts since we’re executing a command directlyvars_files:
- /etc/ansible/group_vars/switches.yml
tasks:
-
name: Get OS version
ansible.netcommon.cli_command:
commands:
- show version
register: os_version_output -
name: Display OS version
debug:
msg: “OS Version of {{ inventory_hostname }} is {{ os_version_output.stdout }}”
My hosts file has this group lines in it:
[switches]
10.84.0.201
I can confirm that module ansible.netcommon is installed.
[root@paok group_vars]# ansible-galaxy collection list | grep ansible.netcommon
ansible.netcommon 6.0.0
[root@paok net]# ansible-galaxy collection list | grep dellemc.os6
dellemc.os6 1.0.7
Do you see anything wrong?
Thank you
Kabamaru