Skip to content

Commit

Permalink
merged state working
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruchip16 committed Apr 20, 2024
1 parent 2445819 commit f18dfdc
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 21 deletions.
14 changes: 12 additions & 2 deletions plugins/module_utils/network/ios/argspec/vrf_global/vrf_global.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,21 @@ class Vrf_globalArgs(object): # pylint: disable=R0903
"description": {"type": "str"},
"ipv4": {
"type": "dict",
"options": {"multicast": {"type": "bool"}},
"options": {
"multicast": {
"type": "dict",
"options": {"multitopology": {"type": "bool"}},
}
},
},
"ipv6": {
"type": "dict",
"options": {"multicast": {"type": "bool"}},
"options": {
"multicast": {
"type": "dict",
"options": {"multitopology": {"type": "bool"}},
}
},
},
"rd": {"type": "str"},
"route_target": {
Expand Down
16 changes: 8 additions & 8 deletions plugins/module_utils/network/ios/config/vrf_global/vrf_global.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ def __init__(self, module):
self.parsers = [
"name",
"description",
"ipv4_multicast_multitopology",
"ipv6_multicast_multitopology",
"ipv4.multicast.multitopology",
"ipv6.multicast.multitopology",
"rd",
"route_target_export",
"route_target_import_config",
"route_target_both",
"vnet_tag",
"vpn_id",
"route_target.export",
"route_target.import_config",
"route_target.both",
"vnet.tag",
"vpn.id",
]

def execute_module(self):
Expand Down Expand Up @@ -105,4 +105,4 @@ def _compare(self, want, have):
self.compare(parsers=self.parsers, want=want, have=have)

def _get_config(self):
return self._connection.get("show running-config vrf")
return self._connection.get("show running-config vrf")
14 changes: 7 additions & 7 deletions plugins/module_utils/network/ios/rm_templates/vrf_global.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def __init__(self, lines=None, module=None):
},
},
{
"name": "ipv4_multicast_multitopology",
"name": "ipv4.multicast.multitopology",
"getval": re.compile(
r"""
\s+ipv4\smulticast\s(?P<multitopology>multitopology)
Expand All @@ -81,7 +81,7 @@ def __init__(self, lines=None, module=None):
},
},
{
"name": "ipv6_multicast_multitopology",
"name": "ipv6.multicast.multitopology",
"getval": re.compile(
r"""
\s+ipv6\smulticast\s(?P<multitopology>multitopology)
Expand Down Expand Up @@ -115,7 +115,7 @@ def __init__(self, lines=None, module=None):
},
},
{
"name": "route_target_export",
"name": "route_target.export",
"getval": re.compile(
r"""
\s+route-target\sexport\s(?P<route_target_export>\S+)
Expand All @@ -132,7 +132,7 @@ def __init__(self, lines=None, module=None):
},
},
{
"name": "route_target_import_config",
"name": "route_target.import_config",
"getval": re.compile(
r"""
\s+route-target\simport\s(?P<route_target_import_config>\S+)
Expand All @@ -149,7 +149,7 @@ def __init__(self, lines=None, module=None):
},
},
{
"name": "route_target_both",
"name": "route_target.both",
"getval": re.compile(
r"""
\s+route-target\sboth\s(?P<route_target_both>\S+)
Expand All @@ -166,7 +166,7 @@ def __init__(self, lines=None, module=None):
},
},
{
"name": "vnet_tag",
"name": "vnet.tag",
"getval": re.compile(
r"""
\s+vnet\stag\s(?P<vnet_tag>\d+)
Expand All @@ -183,7 +183,7 @@ def __init__(self, lines=None, module=None):
},
},
{
"name": "vpn_id",
"name": "vpn.id",
"getval": re.compile(
r"""
\s+vpn\sid\s(?P<vpn_id>\S+)
Expand Down
16 changes: 12 additions & 4 deletions plugins/modules/ios_vrf_global.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,22 @@
suboptions:
multicast:
description: IP Multicast configuration
type: bool
type: dict
suboptions:
multitopology:
description: Enable Multicast-Specific RPF Topology
type: bool
ipv6:
description: VRF IPv6 configuration
type: dict
suboptions:
multicast:
description: IP Multicast configuration
type: bool
type: dict
suboptions:
multitopology:
description: Enable Multicast-Specific RPF Topology
type: bool
rd:
description: Specify Route Distinguisher (RD).
type: str
Expand Down Expand Up @@ -162,10 +170,10 @@
"""

from ansible.module_utils.basic import AnsibleModule
from ansible_collections.cisco.ios.ios.plugins.module_utils.network.ios.argspec.vrf_global.vrf_global import (
from ansible_collections.cisco.ios.plugins.module_utils.network.ios.argspec.vrf_global.vrf_global import (
Vrf_globalArgs,
)
from ansible_collections.cisco.ios.ios.plugins.module_utils.network.ios.config.vrf_global.vrf_global import (
from ansible_collections.cisco.ios.plugins.module_utils.network.ios.config.vrf_global.vrf_global import (
Vrf_global,
)

Expand Down

0 comments on commit f18dfdc

Please sign in to comment.