Closed digitalfiend64 closed 1 year ago
@digitalfiend64 I tried following example
- name: populate lag intergface config
hosts: iosxr
gather_facts: false
tasks:
- name: Setup
connection: ansible.netcommon.network_cli
vars:
ansible_iosxr_commit_label: commit_label_test
cisco.iosxr.iosxr_lag_interfaces:
config:
- name: Bundle-Ether11
mode: active
members:
- member: GigabitEthernet0/0/0/8
mode: passive
- member: GigabitEthernet0/0/0/9
mode: passive
state: merged
following is the result on device:
RP/0/RP0/CPU0:foo#show configuration commit list 2
Mon Jan 23 13:08:27.518 UTC
SNo. Label/ID User Line Client Time Stamp
~~~~ ~~~~~~~~ ~~~~ ~~~~ ~~~~~~ ~~~~~~~~~~
1 commit_label_test admin vty1:node0_RP0_CPU CLI Mon Jan 23 13:07:56 2023
2 1000001161 admin vty0:node0_RP0_CPU CLI Mon Jan 23 13:05:05 2023
Following is the iosxr version on which i tried
RP/0/RP0/CPU0:foo#show version
Mon Jan 23 13:10:10.350 UTC
Cisco IOS XR Software, Version 7.2.2
Copyright (c) 2013-2021 by Cisco Systems, Inc.
Build Information:
Built By : ingunawa
Built On : Mon Jan 25 21:30:50 PST 2021
Built Host : iox-ucs-012
Workspace : /auto/srcarchive15/prod/7.2.2/xrv9k/ws
Version : 7.2.2
Location : /opt/cisco/XR/packages/
Label : 7.2.2-0
cisco IOS-XRv 9000 () processor
System uptime is 7 weeks 4 days 1 hour 50 minutes
RP/0/RP0/CPU0:foo#
@digitalfiend64 We have also tested this on physical router 7.10.0 which is latest one PF below logs
(ansible_collections) prramoor @ ~/Ansible/iosxr $ ansible-playbook -i inventory.yaml iosxr.yaml -vvvvv
ansible-playbook [core 2.13.5] (detached HEAD 09cf0ed123) last updated 2023/01/24 16:52:57 (GMT +550)
config file = /Users/prramoor/Ansible/iosxr/ansible.cfg
configured module search path = ['/Users/prramoor/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /Users/prramoor/Ansible/iosxr/ansible/lib/ansible
ansible collection location = /Users/prramoor/.ansible/collections:/usr/share/ansible/collections
executable location = /Users/prramoor/Ansible/iosxr/ansible/bin/ansible-playbook
python version = 3.8.0 (default, Apr 13 2020, 16:49:15) [Clang 11.0.3 (clang-1103.0.32.29)]
jinja version = 3.0.3
libyaml = True
Using /Users/prramoor/Ansible/iosxr/ansible.cfg as config file
setting up inventory plugins
host_list declined parsing /Users/prramoor/Ansible/iosxr/inventory.yaml as it did not pass its verify_file() method
script declined parsing /Users/prramoor/Ansible/iosxr/inventory.yaml as it did not pass its verify_file() method
Parsed /Users/prramoor/Ansible/iosxr/inventory.yaml inventory source with yaml plugin
Loading collection cisco.iosxr from /Users/prramoor/Ansible/iosxr/collections/ansible_collections/cisco/iosxr
Loading callback plugin default of type stdout, v2.0 from /Users/prramoor/Ansible/iosxr/ansible/lib/ansible/plugins/callback/default.py
Attempting to use 'default' callback.
Skipping callback 'default', as we already have a stdout callback.
Attempting to use 'junit' callback.
Attempting to use 'minimal' callback.
Skipping callback 'minimal', as we already have a stdout callback.
Attempting to use 'oneline' callback.
Skipping callback 'oneline', as we already have a stdout callback.
Attempting to use 'tree' callback.
PLAYBOOK: iosxr.yaml ********************************************************************************************************************************************************************
Positional arguments: iosxr.yaml
verbosity: 5
connection: smart
timeout: 10
become_method: sudo
tags: ('all',)
inventory: ('/Users/prramoor/Ansible/iosxr/inventory.yaml',)
forks: 5
1 plays in iosxr.yaml
PLAY [IOS XR comment and commit config testing on 7.3.1 image] **************************************************************************************************************************
META: ran handlers
TASK [Show version] *********************************************************************************************************************************************************************
task path: /Users/prramoor/Ansible/iosxr/iosxr.yaml:6
Loading collection ansible.netcommon from /Users/prramoor/Ansible/iosxr/collections/ansible_collections/ansible/netcommon
<10.64.78.169> attempting to start connection
<10.64.78.169> using connection plugin ansible.netcommon.network_cli
Found ansible-connection at path /Users/prramoor/Ansible/iosxr/ansible/bin/ansible-connection
<10.64.78.169> local domain socket does not exist, starting it
<10.64.78.169> control socket path is /Users/prramoor/.ansible/pc/1fe240443e
<10.64.78.169> Loading collection ansible.netcommon from /Users/prramoor/Ansible/iosxr/collections/ansible_collections/ansible/netcommon
<10.64.78.169> Loading collection cisco.iosxr from /Users/prramoor/Ansible/iosxr/collections/ansible_collections/cisco/iosxr
<10.64.78.169> local domain socket listeners started successfully
<10.64.78.169> loaded cliconf plugin ansible_collections.cisco.iosxr.plugins.cliconf.iosxr from path /Users/prramoor/Ansible/iosxr/collections/ansible_collections/cisco/iosxr/plugins/cliconf/iosxr.py for network_os cisco.iosxr.iosxr
<10.64.78.169> ssh type is set to auto
<10.64.78.169> autodetecting ssh_type
<10.64.78.169> ssh type is now set to libssh
<10.64.78.169>
<10.64.78.169> local domain socket path is /Users/prramoor/.ansible/pc/1fe240443e
<10.64.78.169> Using network group action cisco.iosxr.iosxr for cisco.iosxr.iosxr_command
<10.64.78.169> ANSIBLE_NETWORK_IMPORT_MODULES: enabled
<10.64.78.169> ANSIBLE_NETWORK_IMPORT_MODULES: found cisco.iosxr.iosxr_command at /Users/prramoor/Ansible/iosxr/collections/ansible_collections/cisco/iosxr/plugins/modules/iosxr_command.py
<10.64.78.169> ANSIBLE_NETWORK_IMPORT_MODULES: running cisco.iosxr.iosxr_command
<10.64.78.169> ANSIBLE_NETWORK_IMPORT_MODULES: complete
<10.64.78.169> ANSIBLE_NETWORK_IMPORT_MODULES: Result: {'changed': False, 'stdout': ['Cisco IOS XR Software, Version 7.10.1\nCopyright (c) 2013-2022 by Cisco Systems, Inc.\n\nBuild Information:\n Built By :\n Built On : Mon Dec 26 17:19:00 IST 2022\n Built Host :\n Workspace : \n Version : 7.10.1\n Location : /opt/cisco/XR/packages/\n Label : 7.10.1\n\ncisco NCS-5500 () processor\nSystem uptime is 3 hours 40 minutes'], 'stdout_lines': [['Cisco IOS XR Software, Version 7.10.1', 'Copyright (c) 2013-2022 by Cisco Systems, Inc.', '', 'Build Information:', ' Built By :', ' Built On : Mon Dec 26 17:19:00 IST 2022', ' Built Host : ', ' Workspace : ', ' Version : 7.10.1', ' Location : /opt/cisco/XR/packages/', ' Label : 7.10.1', '', 'cisco NCS-5500 () processor', 'System uptime is 3 hours 40 minutes']], 'invocation': {'module_args': {'commands': ['show version'], 'match': 'all', 'retries': 10, 'interval': 1, 'wait_for': None}}, '_ansible_parsed': True}
ok: [10.64.78.169] => {
"changed": false,
"invocation": {
"module_args": {
"commands": [
"show version"
],
"interval": 1,
"match": "all",
"retries": 10,
"wait_for": null
}
},
"stdout": [
"Cisco IOS XR Software, Version 7.10.1\nCopyright (c) 2013-2022 by Cisco Systems, Inc.\n\nBuild Information:\n Built By :\n Built On : Mon Dec 26 17:19:00 IST 2022\n Built Host :\n Workspace : \n Version : 7.10.1\n Location : /opt/cisco/XR/packages/\n Label : 7.10.1\n\ncisco NCS-5500 () processor\nSystem uptime is 3 hours 40 minutes"
],
"stdout_lines": [
[
"Cisco IOS XR Software, Version 7.10.1",
"Copyright (c) 2013-2022 by Cisco Systems, Inc.",
"",
"Build Information:",
" Built By :",
" Built On : Mon Dec 26 17:19:00 IST 2022",
" Built Host :",
" Workspace :",
" Version : 7.10.1",
" Location : /opt/cisco/XR/packages/",
" Label : 7.10.1",
"",
"cisco NCS-5500 () processor",
"System uptime is 3 hours 40 minutes"
]
]
}
TASK [Setup] ****************************************************************************************************************************************************************************
task path: /Users/prramoor/Ansible/iosxr/iosxr.yaml:10
Loading collection ansible.netcommon from /Users/prramoor/Ansible/iosxr/collections/ansible_collections/ansible/netcommon
<10.64.78.169> attempting to start connection
<10.64.78.169> using connection plugin ansible.netcommon.network_cli
Found ansible-connection at path /Users/prramoor/Ansible/iosxr/ansible/bin/ansible-connection
<10.64.78.169> found existing local domain socket, using it!
<10.64.78.169> invoked shell using ssh_type: libssh
<10.64.78.169> ssh connection done, setting terminal
<10.64.78.169> loaded terminal plugin for network_os cisco.iosxr.iosxr
<10.64.78.169> firing event: on_open_shell()
<10.64.78.169> ssh connection has completed successfully
<10.64.78.169> updating play_context for connection
<10.64.78.169>
<10.64.78.169> local domain socket path is /Users/prramoor/.ansible/pc/1fe240443e
<10.64.78.169> Using network group action cisco.iosxr.iosxr for cisco.iosxr.iosxr_lag_interfaces
<10.64.78.169> ANSIBLE_NETWORK_IMPORT_MODULES: enabled
<10.64.78.169> ANSIBLE_NETWORK_IMPORT_MODULES: found cisco.iosxr.iosxr_lag_interfaces at /Users/prramoor/Ansible/iosxr/collections/ansible_collections/cisco/iosxr/plugins/modules/iosxr_lag_interfaces.py
<10.64.78.169> ANSIBLE_NETWORK_IMPORT_MODULES: running cisco.iosxr.iosxr_lag_interfaces
<10.64.78.169> ANSIBLE_NETWORK_IMPORT_MODULES: complete
<10.64.78.169> ANSIBLE_NETWORK_IMPORT_MODULES: Result: {'changed': True, 'commands': ['interface Bundle-Ether12', 'lacp mode active', 'interface GigabitEthernet0/0/0/11', 'bundle id 12 mode passive', 'interface GigabitEthernet0/0/0/10', 'bundle id 12 mode passive'], 'before': [{'members': [{'member': 'GigabitEthernet0/0/0/8', 'mode': 'passive'}, {'member': 'GigabitEthernet0/0/0/9', 'mode': 'passive'}], 'mode': 'active', 'name': 'Bundle-Ether11'}], 'after': [{'members': [{'member': 'GigabitEthernet0/0/0/8', 'mode': 'passive'}, {'member': 'GigabitEthernet0/0/0/9', 'mode': 'passive'}], 'mode': 'active', 'name': 'Bundle-Ether11'}, {'members': [{'member': 'GigabitEthernet0/0/0/10', 'mode': 'passive'}, {'member': 'GigabitEthernet0/0/0/11', 'mode': 'passive'}], 'mode': 'active', 'name': 'Bundle-Ether12'}], 'invocation': {'module_args': {'config': [{'name': 'Bundle-Ether12', 'mode': 'active', 'members': [{'member': 'GigabitEthernet0/0/0/11', 'mode': 'passive'}, {'member': 'GigabitEthernet0/0/0/10', 'mode': 'passive'}], 'links': None, 'load_balancing_hash': None}], 'state': 'merged', 'running_config': None}}, '_ansible_parsed': True}
changed: [10.64.78.169] => {
"after": [
{
"members": [
{
"member": "GigabitEthernet0/0/0/8",
"mode": "passive"
},
{
"member": "GigabitEthernet0/0/0/9",
"mode": "passive"
}
],
"mode": "active",
"name": "Bundle-Ether11"
},
{
"members": [
{
"member": "GigabitEthernet0/0/0/10",
"mode": "passive"
},
{
"member": "GigabitEthernet0/0/0/11",
"mode": "passive"
}
],
"mode": "active",
"name": "Bundle-Ether12"
}
],
"before": [
{
"members": [
{
"member": "GigabitEthernet0/0/0/8",
"mode": "passive"
},
{
"member": "GigabitEthernet0/0/0/9",
"mode": "passive"
}
],
"mode": "active",
"name": "Bundle-Ether11"
}
],
"changed": true,
"commands": [
"interface Bundle-Ether12",
"lacp mode active",
"interface GigabitEthernet0/0/0/11",
"bundle id 12 mode passive",
"interface GigabitEthernet0/0/0/10",
"bundle id 12 mode passive"
],
"invocation": {
"module_args": {
"config": [
{
"links": null,
"load_balancing_hash": null,
"members": [
{
"member": "GigabitEthernet0/0/0/11",
"mode": "passive"
},
{
"member": "GigabitEthernet0/0/0/10",
"mode": "passive"
}
],
"mode": "active",
"name": "Bundle-Ether12"
}
],
"running_config": null,
"state": "merged"
}
}
}
META: ran handlers
META: ran handlers
PLAY RECAP ******************************************************************************************************************************************************************************
10.64.78.169 : ok=2 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
RP/0/RP0/CPU0:NCS5500#show configuration commit list 2
Tue Jan 24 11:54:26.828 UTC
SNo. Label/ID User Line Client Time Stamp
~~~~ ~~~~~~~~ ~~~~ ~~~~ ~~~~~~ ~~~~~~~~~~
1 commit_label_test_1 root vty0:node0_RP0_CPU CLI Tue Jan 24 11:51:33 2023
2 commit_label_test root vty0:node0_RP0_CPU CLI Tue Jan 24 11:45:21 2023
RP/0/RP0/CPU0:NCS5500#
RP/0/RP0/CPU0:NCS5500#
RP/0/RP0/CPU0:NCS5500#
RP/0/RP0/CPU0:NCS5500#
RP/0/RP0/CPU0:NCS5500#
RP/0/RP0/CPU0:NCS5500#show version
Tue Jan 24 11:54:32.489 UTC
Cisco IOS XR Software, Version 7.10.1
Copyright (c) 2013-2022 by Cisco Systems, Inc.
Build Information:
Built By :
Built On : Mon Dec 26 17:19:00 IST 2022
Built Host :
Workspace :
Version : 7.10.1
Location : /opt/cisco/XR/packages/
Label : 7.10.1
cisco NCS-5500 () processor
System uptime is 3 hours 43 minutes
RP/0/RP0/CPU0:NCS5500#
This is same issue like https://github.com/ansible-collections/cisco.iosxr/issues/314
SUMMARY
When executing config changes to IOSXR device with the cisco.iosxr.iosxr_lag_interfaces module with the var “ansible_iosxr_commit_label” provided in the required string format, the resulting commit record on the device does not have the label. Tested on ASR9k device. Label is applied correctly from other example IOSXR modules to same devices, like iosxr_interfaces.
ISSUE TYPE
COMPONENT NAME
cisco.iosxr.iosxr_lag_interfaces
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
RP/0/RSP1/CPU0:ASR9K-01#show version Tue Jan 17 13:52:42.385 GMT
Cisco IOS XR Software, Version 6.5.3[Default] Copyright (c) 2019 by Cisco Systems, Inc.
ROM: System Bootstrap, Version 10.65(c) 1994-2014 by Cisco Systems, Inc.
ASR9K-01 uptime is 1 year, 28 weeks, 5 days, 1 minute System image file is "disk0:asr9k-os-mbi-6.5.3/0x100305/mbiasr9k-rsp3.vm"
cisco ASR9K Series (Intel 686 F6M14S4) processor with 16777216K bytes of memory. Intel 686 F6M14S4 processor at 1904MHz, Revision 2.174 ASR-9010 8 Line Card Slot Chassis with V3 AC PEM