Raw module shell selection

Hello,

Im trying to figure out how to use ansible.builtin.raw module with cisco devices.
On previous ansible version it would communicate with cisco ios on its own somehow but not since I upgraded to ansible [core 2.15.6].
now I keep getting shell error and I cant find documentation on how to select cisco shell.

1 │ —
2 │ - name: ARP
3 │ hosts: all
4 │ gather_facts: false
5 │ connection: ansible.netcommon.network_cli
6 │ vars:
7 │ ansible_network_os: cisco.ios.ios
8 │
9 │ tasks:
10 │ - name: Show ARP
11 │ ansible.builtin.raw: “show arp”
12 │ register: print_output
13 │
14 │ - name: Print out verbose
15 │ ansible.builtin.debug: var=print_output.stdout_lines

ap raw/arp.yml

PLAY [ARP] ***********************************************************************************************************************************************

TASK [Show ARP] ******************************************************************************************************************************************
fatal: [3750g]: FAILED! => {“changed”: true, “msg”: “non-zero return code”, “rc”: 127, “stderr”: “/bin/sh: 1: show: not found\n”, “stderr_lines”: [“/bin/sh: 1: show: not found”], “stdout”: “”, “stdout_lines”: }
fatal: [2960g]: FAILED! => {“changed”: true, “msg”: “non-zero return code”, “rc”: 127, “stderr”: “/bin/sh: 1: show: not found\n”, “stderr_lines”: [“/bin/sh: 1: show: not found”], “stdout”: “”, “stdout_lines”: }

PLAY RECAP ***********************************************************************************************************************************************
2960g : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
3750g : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0

Hello @johntxjw ,

Is there any specific reason you’re using the ansible.builtin.raw module? Because I’d use the ansible.netcommon.cli_command instead…

Cheers

1 Like

Hello again,

I recently starting to use ansible with my home lab and tutorial I’ve been viewing start of by using raw module/ad-hoc to learn ansible, but other than that no particular reason.
I have been having a escalation issue with ioscommand module but I will create another help topic for that.

Thanks again

1 Like

Hi @johntxjw,

Thank you for the clarification provided.

Could I kindly request you to mark this topic as solved? This will help maintain organization within the forum’s “get-help” category, showcasing the original post as resolved. Your assistance with this is greatly appreciated! :blush:

Looking forward to future interactions! See you around!

Best regards

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