Privelege escalation using cisco ioscommand module

Hello,

I’ve been having issues with cisco modules. I keep getting a privelege escalation error when I run my playbooks against some of my inventory in my home lab which I found odd since it started once I updated my ansible version.

I’ll attach some screnshots.


I believe I may have found fix but I’m not sure and even worse I don’t know how to apply it.

Found this on Github

Hello @johntxjw,

To assist you more effectively, could you please provide further details about your environment? Specifically, sharing the playbook’s task, especially the one labeled as “reload devices,” would be immensely helpful. Additionally, obtaining the playbook’s verbose output (using -vvv) and specifying the version of ansible-core you’re currently running would greatly aid in troubleshooting.

As a suggestion, you might consider updating the cisco.ios collection—assuming that’s the one in use—by executing the following command:

ansible-galaxy collection install cisco.ios --force

Also, make sure you’re using the full FQCN on your task, not just the module’s name, like in this example:

- name: Backup current switch config (ios)
  cisco.ios.ios_config:
    backup: yes
  register: backup_ios_location
  when: ansible_network_os == 'cisco.ios.ios'

Furthermore, I recommend reviewing all the relevant information available on these documentation pages to ensure no crucial steps are overlooked:

https://docs.ansible.com/ansible/latest/network/user_guide/platform_ios.html

https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_privilege_escalation.html#become-and-network-automation

Hope it helps!

EDIT: I forgot to ask, What ios version you got on the managed nodes that are failing to authenticate?

1 Like

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