cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
652
Views
0
Helpful
0
Replies

Ansible Cisco.Iosxr collection not working with virtual Cisco IOS XR R

lukassgg
Level 1
Level 1

I'm trying to configure Cisco IOS XR devices with Ansible. I assume the Cisco.Iosxr collection would be suitable for such task. But the Cisco.Iosxr collection seems to envoke a command "show inventory", which does not exist on my IOS XR devices.

Cisco IOS XR Version:

RP/0/RP0/CPU0:XR3#show version
Tue May 23 08:42:26.758 UTC
Cisco IOS XR Software, Version 7.8.1 LNT
Copyright (c) 2013-2022 by Cisco Systems, Inc.

Build Information:
Built By : ingunawa
Built On : Wed Nov 30 13:00:28 UTC 2022
Build Host : iox-lnx-108
Workspace : /auto/srcarchive13/prod/7.8.1/xrd-control-plane/ws
Version : 7.8.1
Label : 7.8.1

cisco XRd Control Plane
cisco XRd-CP-C-01 processor with 512GB of memory
XR3 uptime is 3 weeks, 6 days, 17 hours, 11 minutes
XRd Control Plane Container

Ansible Playbook

name: Create Config Backup
hosts: CERouters
gather_facts: false
tasks:
  - name: backup
    cisco.iosxr.iosxr_config:
      backup: yes

Ansible playbook output

fatal: [xr3]: FAILED! => {
"changed": false,
"invocation": {
"module_args": {
"admin": false,
"after": null,
"backup": true,
"backup_options": null,
"before": null,
"comment": "configured by iosxr_config",
"config": null,
"disable_default_comment": false,
"exclusive": false,
"force": false,
"label": null,
"lines": null,
"match": "line",
"parents": null,
"replace": "line",
"src": null
}
},
"msg": "show inventory\r\n\r ^\r\n% Invalid input detected at '^' marker.\r\nRP/0/RP0/CPU0:XR3#"
}

With the Cisco.Ios collection I'm able to do a backup, but get more errors when trying to configure VRF with Jinja2 templates. But I think Cisco.Iosxr should be the way to go.

My last approach would be to use the ansible.netcommon.netconf_config module to send JSON/XML commands to the Cisco IOS XR devices, which does work, but is very tedious.

Or is there another Ansible collection to configure Cisco IOS XR devices?

Thanks for any help.

0 Replies 0

Review Cisco Networking for a $25 gift card