Skip to content

Commit

Permalink
address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruchip16 committed Dec 26, 2024
1 parent f894b7f commit 37cbd28
Show file tree
Hide file tree
Showing 8 changed files with 630 additions and 220 deletions.
2 changes: 2 additions & 0 deletions meta/runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,6 @@ plugin_routing:
redirect: cisco.ios.ios_vrf
vxlan_vtep:
redirect: cisco.ios.ios_vxlan_vtep
vrf_address_family:
redirect: cisco.ios.ios_vrf_address_family
requires_ansible: ">=2.14.0"
713 changes: 552 additions & 161 deletions plugins/module_utils/network/ios/rm_templates/vrf_address_family.py

Large diffs are not rendered by default.

52 changes: 13 additions & 39 deletions plugins/modules/ios_vrf_address_family.py
Original file line number Diff line number Diff line change
Expand Up @@ -825,36 +825,6 @@
# - import ipv4 multicast 89 map "import-map"
# - import ipv4 unicast 12 map "ran-map" allow-evpn
#
# after:
# - name: VRF4
# - name: VRF7
# address_families:
# - afi: "ipv4"
# safi: "unicast"
# bgp:
# next_hop:
# loopback: 89
# export:
# ipv4:
# multicast:
# map: "single"
# prefix: 345
# unicast:
# allow_evpn: true
# map: "test-map"
# prefix: 67
# map: "testing-map"
# import_config:
# ipv4:
# multicast:
# map: "import-map1"
# prefix: 89
# unicast:
# allow_evpn: true
# limit: 12
# map: "ran-map"
# map: "import-map"
#
# After state:
# -------------
Expand Down Expand Up @@ -1102,33 +1072,37 @@
before:
description: The configuration prior to the module execution.
returned: when I(state) is C(merged), C(replaced), C(overridden), C(deleted) or C(purged)
type: dict
type: list
sample: >
This output will always be in the same format as the
module argspec.
after:
description: The resulting configuration after module execution.
returned: when changed
type: dict
type: list
sample: >
This output will always be in the same format as the
module argspec.
commands:
description: The set of commands pushed to the remote device.
returned: when I(state) is C(merged), C(replaced), C(overridden), C(deleted) or C(purged)
returned: when I(state) is C(merged), C(replaced), C(overridden), C(deleted)
type: list
sample:
- sample command 1
- sample command 2
- sample command 3
- vrf definition test1
- address-family ipv4 unicast
- bgp next-hop loopback 40
- export map "testing-map"
- export ipv4 multicast 345 map "testmap"
rendered:
description: The provided configuration in the task rendered in device-native format (offline).
returned: when I(state) is C(rendered)
type: list
sample:
- sample command 1
- sample command 2
- sample command 3
- vrf definition test1
- address-family ipv4 unicast
- bgp next-hop loopback 40
- import map "testing-map"
- export ipv4 multicast 345 map "testmap"
gathered:
description: Facts about the network resource gathered from the remote device as structured data.
returned: when I(state) is C(gathered)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
vrf definition test
address-family ipv4 unicast
bgp next-hop loopback 23
import map "import-map"
import ipv4 multicast 89 map "import-map"
import ipv4 unicast 12 map "ran-map" allow-evpn
export map "testing-map"
export ipv4 multicast 345 map "single"
export ipv4 unicast 67 map "test-map" allow-evpn
address-family ipv4
import ipv4 unicast 56 map import allow-evpn
export map testing-map2
export ipv4 unicast 37 map test allow-evpn
mdt auto-discovery pim pim-tlv-announce mdt-hello-enable
mdt auto-discovery receiver-site
route-target export 10.12.0.1:20
route-target import 10.0.0.1:30
route-target export 10.12.0.1:20 stitching
route-target import 10.0.0.1:30 stitching
maximum routes 1 2 reinstall 2
inter-as-hybrid next-hop 1.2.3.4
bgp next-hop Loopback23
exit-address-family
Original file line number Diff line number Diff line change
@@ -1,10 +1,39 @@
---
- name: Merge provided configuration with device configuration
- name: Populate VRF configuration
register: result
cisco.ios.ios_config:
lines:
- vrf definition test
- address-family ipv4 unicast
- bgp next-hop loopback 23
- import map "import-map"
- export map "testing-map"
cisco.ios.ios_vrf_address_family:
config:
- name: test1
address_families:
- afi: "ipv4"
safi: "unicast"
export:
ipv4:
multicast:
map: "single"
prefix: 345
unicast:
allow_evpn: true
map: "test-map"
prefix: 67
map: "testing-map"
import_config:
ipv4:
multicast:
map: "import-map"
prefix: 89
unicast:
allow_evpn: true
limit: 12
map: "ran-map"
map: "import-map"
inter_as_hybrid:
csc:
next_hop: "1.2.3.4"
next_hop: "1.0.0.0"
mdt:
auto_discovery:
pim:
pim_tlv_announce:
mdt_hello_enable: true
state: merged
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
- name: Remove VRF global configurations
cisco.iosxr.iosxr_config:
cisco.ios.ios_config:
lines:
- no vrf definition VRF4
- no vrf definition VRF6
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
register: result
cisco.ios.ios_vrf_address_family: &deleted
config:
- name: test1
state: deleted

- ansible.builtin.assert:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
address_families:
- afi: "ipv4"
safi: "unicast"
bgp:
next_hop:
loopback: 40
export:
ipv4:
multicast:
Expand All @@ -35,6 +32,17 @@
limit: 12
map: "ran-map"
map: "import-map"
- name: test2
address_families:
- afi: "ipv4"
safi: "unicast"
export:
map: "testing-map1"
import_config:
map: "import-map1"
inter_as_hybrid:
csc:
next_hop: "1.2.3.4"
register: result

- name: Assert that correct set of commands were generated
Expand Down

0 comments on commit 37cbd28

Please sign in to comment.