Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
21dc0d2
fixing_inventory
Oct 15, 2025
bf66e27
Update multi.yaml
AAYUSH2091 Oct 15, 2025
ec9b084
Update multi.yaml
AAYUSH2091 Oct 15, 2025
d0cd412
Update multi.yaml
AAYUSH2091 Oct 15, 2025
5812633
fixes_tests
Oct 23, 2025
3ad67e8
Update main.yaml
AAYUSH2091 Oct 23, 2025
0277f70
Merge branch 'main' into fixing_tests
AAYUSH2091 Oct 23, 2025
ae53fd7
chore: auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 23, 2025
16bde14
removed_comment
Oct 23, 2025
290aa5d
fixed_import_error
Oct 23, 2025
6825805
fixed_parser
Oct 23, 2025
784a19c
Update iosxr.py
AAYUSH2091 Oct 23, 2025
a43436b
Update iosxr.py
AAYUSH2091 Oct 23, 2025
9468384
fixes_idempotent_issue
Oct 23, 2025
ed975b4
chore: auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 23, 2025
d81c128
revert_last_commit
Oct 24, 2025
dad19fc
Update l3_interfaces.py
AAYUSH2091 Oct 24, 2025
c6819e5
Update IOSXR topology removing multiple nodes (#574)
AAYUSH2091 Oct 24, 2025
483a019
fixing_inventory
Oct 15, 2025
8477502
Update multi.yaml
AAYUSH2091 Oct 15, 2025
95342e7
chore: auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 23, 2025
45544e1
fix
Oct 24, 2025
0190aa1
Merge branch 'main' into fixing_tests
AAYUSH2091 Oct 24, 2025
2814a16
Update multi.yaml
AAYUSH2091 Oct 24, 2025
d15a2bb
Update iosxr.py
AAYUSH2091 Oct 26, 2025
7642dc2
chore: auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 26, 2025
cd422f8
Update iosxr.py
AAYUSH2091 Oct 26, 2025
de097b0
chore: auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 26, 2025
8541f25
Merge branch 'main' into fixing_tests
AAYUSH2091 Oct 27, 2025
d3ed229
Update main.yaml
AAYUSH2091 Oct 27, 2025
993aca1
fixes_routes_maps
Oct 27, 2025
f4346e5
fixes_routes_maps_
Oct 27, 2025
ca5ad95
fixed_parser
Oct 27, 2025
32929f7
minor_fixes
Oct 27, 2025
82dadb0
chore: auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 27, 2025
86d80ba
fixes_vrf_interfaces_test
Oct 27, 2025
d8d89cf
fixed_vrf_interfaces
Oct 27, 2025
771d2e0
minor_fix
Oct 27, 2025
269f1b7
reverting_the_fix_for_fallback_logic
Oct 29, 2025
edcc7d9
refined_lxml_import
Oct 29, 2025
1c147a1
remove_fallback_to_xml
Oct 29, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions plugins/module_utils/network/iosxr/rm_templates/route_maps.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,13 +333,13 @@ def __init__(self, lines=None, module=None):
"getval": re.compile(
r"""
\s*set\scommunity
(\s(?P<community_name>.*))?
(\s(?P<community_name>(.*?)))?
(\s(?P<additive>additive))?
$""", re.VERBOSE,
),
"setval": "set community"
"{{ (' ' + set.community.community_name ) if set.community.community_name is defined else '' }}"
"{{ (' additive' ) if set.community.additive is defined else '' }}",
"{{ (' additive') if set.community.additive|d(False) else '' }}",
"result": {
"policies": {
"set": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- GigabitEthernet 0/0/0/3.900
- GigabitEthernet 0/0/0/4
- GigabitEthernet0/0/0/4.1
- GigabitEthernet0/0/0/5
ignore_errors: true
cisco.iosxr.iosxr_config:
lines:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
register: result
cisco.iosxr.iosxr_l2_interfaces: &id001
config:
- name: GigabitEthernet0/0/0/1
- name: GigabitEthernet0/0/0/4
l2transport: true
l2protocol:
- cpsv: drop
Expand Down
8 changes: 5 additions & 3 deletions tests/integration/targets/iosxr_l2_interfaces/vars/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,23 +55,24 @@ replaced:
l2transport: true
name: GigabitEthernet0/0/0/4
commands:
- interface GigabitEthernet0/0/0/1
- interface GigabitEthernet0/0/0/4
- no l2transport
- l2transport l2protocol cpsv drop
after:
- name: Loopback888
- name: Loopback999
- name: MgmtEth0/RP0/CPU0/0
- l2protocol:
- cpsv: drop
- cpsv: tunnel
l2transport: true
propagate: true
name: GigabitEthernet0/0/0/1
- name: GigabitEthernet0/0/0/3.900
encapsulation:
dot1q: 40
second_dot1q: 60
- l2protocol:
- cpsv: tunnel
- cpsv: drop
l2transport: true
name: GigabitEthernet0/0/0/4

Expand Down Expand Up @@ -140,3 +141,4 @@ deleted:
- name: Loopback999
- name: MgmtEth0/RP0/CPU0/0
- name: GigabitEthernet0/0/0/3.900
- name: GigabitEthernet0/0/0/4
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
mac: 00c2.4c00.bd15

- name: GigabitEthernet0/0/0/1
period: 100
period: 200
state: merged

- name: Gather interfaces facts using gathered state
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
mac: 00c2.4c00.bd15

- name: GigabitEthernet0/0/0/1
period: 100
period: 200
state: merged

- name: Assert that before dicts were correctly generated
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ merged:
- interface Bundle-Ether11
- lacp system mac 00c2.4c00.bd15
- interface GigabitEthernet0/0/0/1
- lacp period 100
- lacp period 200
after:
- name: Bundle-Ether10
churn_logging: actor
Expand All @@ -22,7 +22,7 @@ merged:
mac: 00c2.4c00.bd15
- name: GigabitEthernet0/0/0/0
- name: GigabitEthernet0/0/0/1
period: 100
period: 200
populate:
- name: Bundle-Ether10
churn_logging: actor
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
route-policy POLICY_TWO_PARAMS($SPECIFICITY, $GEO_LOCATION)
set community (64496:100, 64496:$SPECIFICITY, 64496:$GEO_LOCATION, 65012:174)
set local-preference 150
end-policy
!
route-policy COMPLEX_ROUTE_POLICY
if destination in A_RANDOM_POLICY_DUMMY then
drop
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@
condition: community matches-any (9119:1001) or community matches-any (11100:1001)
drop: true
name: COMPLEX_CONDITION_ROUTE_POLICY
- global:
set:
community:
community_name: (64496:100, 64496:$SPECIFICITY, 64496:$GEO_LOCATION, 65012:174)
local_preference:
- metric_number: 150
name: POLICY_TWO_PARAMS($SPECIFICITY, $GEO_LOCATION)
register: result

- name: Assert that before dicts were correctly generated
Expand Down
48 changes: 37 additions & 11 deletions tests/integration/targets/iosxr_route_maps/vars/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ merged:
- "set extcommunity rt 65000:100 additive"
- "set weight 20000"
- "end-policy"
- "route-policy POLICY_TWO_PARAMS($SPECIFICITY, $GEO_LOCATION)"
- "set community (64496:100, 64496:$SPECIFICITY, 64496:$GEO_LOCATION, 65012:174)"
- "set local-preference 150\n"
- "end-policy"
- "route-policy SIMPLE_CONDITION_ROUTE_POLICY"
- "if destination in SIMPLE_CONDITION_ROUTE_POLICY then"
- "pass"
Expand All @@ -34,27 +38,34 @@ merged:
- "endif"
- "end-policy"
after:
- global:
set:
community:
community_name: "(64496:100, 64496:$SPECIFICITY, 64496:$GEO_LOCATION, 65012:174)"
local_preference:
- metric_number: 150
name: "POLICY_TWO_PARAMS($SPECIFICITY, $GEO_LOCATION)"
- else_section:
else_section:
drop: true
if_section:
condition: destination in A_RANDOM_POLICY
condition: "destination in A_RANDOM_POLICY"
pass: true
if_section:
condition: destination in A_RANDOM_POLICY_DUMMY
condition: "destination in A_RANDOM_POLICY_DUMMY"
drop: true
name: COMPLEX_ROUTE_POLICY
name: "COMPLEX_ROUTE_POLICY"
- global:
apply:
- route_policy: A_NEW_ROUTE_POLICY
- route_policy: "A_NEW_ROUTE_POLICY"
set:
community:
additive: true
community_name: (11011:1001)
community_name: "(11011:1001)"
med:
value: 100
extcommunity:
rt: 65000:100
rt: "65000:100"
additive: true
weight: 20000
local_preference:
Expand All @@ -64,21 +75,21 @@ merged:
metric_number: 200
- multiply: true
metric_number: 300
name: SIMPLE_GLOBAL_ROUTE_POLICY
name: "SIMPLE_GLOBAL_ROUTE_POLICY"
- else_section:
global:
drop: true
if_section:
condition: destination in SIMPLE_CONDITION_ROUTE_POLICY
condition: "destination in SIMPLE_CONDITION_ROUTE_POLICY"
pass: true
name: SIMPLE_CONDITION_ROUTE_POLICY
name: "SIMPLE_CONDITION_ROUTE_POLICY"
- else_section:
global:
pass: true
if_section:
condition: community matches-any (9119:1001) or community matches-any (11100:1001)
condition: "community matches-any (9119:1001) or community matches-any (11100:1001)"
drop: true
name: COMPLEX_CONDITION_ROUTE_POLICY
name: "COMPLEX_CONDITION_ROUTE_POLICY"

overridden:
commands:
Expand All @@ -100,6 +111,7 @@ overridden:
- endif
- endif
- end-policy
- no route-policy POLICY_TWO_PARAMS($SPECIFICITY, $GEO_LOCATION)
- no route-policy COMPLEX_ROUTE_POLICY
- no route-policy SIMPLE_GLOBAL_ROUTE_POLICY
- no route-policy SIMPLE_CONDITION_ROUTE_POLICY
Expand Down Expand Up @@ -134,6 +146,13 @@ overridden:
metric_number: 300
name: SIMPLE_GLOBAL_ROUTE_POLICY_overridden
before:
- global:
set:
community:
community_name: (64496:100, 64496:$SPECIFICITY, 64496:$GEO_LOCATION, 65012:174)
local_preference:
- metric_number: 150
name: POLICY_TWO_PARAMS($SPECIFICITY, $GEO_LOCATION)
- else_section:
else_section:
drop: true
Expand Down Expand Up @@ -216,6 +235,13 @@ rendered:

deleted:
after:
- global:
set:
community:
community_name: "(64496:100, 64496:$SPECIFICITY, 64496:$GEO_LOCATION, 65012:174)"
local_preference:
- metric_number: 150
name: POLICY_TWO_PARAMS($SPECIFICITY, $GEO_LOCATION)
- global:
apply:
- route_policy: A_NEW_ROUTE_POLICY
Expand Down
8 changes: 4 additions & 4 deletions tests/integration/targets/iosxr_smoke/tests/cli/caching.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
register: result
cisco.iosxr.iosxr_interfaces: &merged
config:
- name: GigabitEthernet0/0/0/1
- name: GigabitEthernet0/0/0/3
description: Configured by Ansible
mtu: 110
enabled: true
Expand All @@ -46,7 +46,7 @@

- ansible.builtin.assert:
that:
- '"interface GigabitEthernet0/0/0/1" in result.commands'
- '"interface GigabitEthernet0/0/0/3" in result.commands'
- '"description Configured by Ansible" in result.commands'
- '"mtu 110" in result.commands'
- '"duplex half" in result.commands'
Expand All @@ -70,7 +70,7 @@
register: result
cisco.iosxr.iosxr_l2_interfaces: &mergedl2
config:
- name: GigabitEthernet0/0/0/1
- name: GigabitEthernet0/0/0/5
l2transport: true
l2protocol:
- cpsv: drop
Expand All @@ -85,7 +85,7 @@

- ansible.builtin.assert:
that:
- '"interface GigabitEthernet0/0/0/1" in result.commands'
- '"interface GigabitEthernet0/0/0/5" in result.commands'
- '"l2transport l2protocol cpsv drop" in result.commands'
- '"l2transport propagate remote-status" in result.commands'
- '"interface GigabitEthernet0/0/0/4.1" in result.commands'
Expand Down
8 changes: 8 additions & 0 deletions tests/integration/targets/iosxr_vrf_interfaces/vars/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ gathered:
vrf_name: vrf_A
- name: GigabitEthernet0/0/0/2
vrf_name: vrf_B
- name: GigabitEthernet0/0/0/3
- name: GigabitEthernet0/0/0/5

merged:
commands:
Expand All @@ -25,6 +27,8 @@ merged:
vrf_name: vrf_C
- name: GigabitEthernet0/0/0/2
vrf_name: vrf_D
- name: GigabitEthernet0/0/0/3
- name: GigabitEthernet0/0/0/5

overridden:
commands:
Expand All @@ -40,6 +44,8 @@ overridden:
- name: GigabitEthernet0/0/0/1
vrf_name: vrf_C
- name: GigabitEthernet0/0/0/2
- name: GigabitEthernet0/0/0/3
- name: GigabitEthernet0/0/0/5
before:
- name: Loopback888
- name: Loopback999
Expand All @@ -49,6 +55,8 @@ overridden:
vrf_name: vrf_A
- name: GigabitEthernet0/0/0/2
vrf_name: vrf_B
- name: GigabitEthernet0/0/0/3
- name: GigabitEthernet0/0/0/5
parsed:
result:
- name: Loopback888
Expand Down
9 changes: 6 additions & 3 deletions tests/integration/targets/prepare_iosxr_tests/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
---
- name: Ensure we have loopback 888 for testing
connection: ansible.netcommon.network_cli
cisco.iosxr.iosxr_config:
src: config.j2
vars:
ansible_connection: ansible.netcommon.network_cli

- name: Enable netconf service
connection: ansible.netcommon.network_cli
tags: netconf
cisco.iosxr.iosxr_netconf:
netconf_port: 830
netconf_vrf: default
state: present
vars:
ansible_connection: ansible.netcommon.network_cli
tags:
- netconf

- name: Set facts
ansible.builtin.set_fact:
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/modules/network/iosxr/test_iosxr_route_maps.py
Original file line number Diff line number Diff line change
Expand Up @@ -1456,4 +1456,4 @@ def test_iosxr_routemap_multiple_params_gathered(self):
},
]
result = self.execute_module(changed=False)
self.assertEqual(gathered, result["gathered"])
self.assertEqual(sorted(gathered), sorted(result["gathered"]))