Skip to content

Instantly share code, notes, and snippets.

@Ruchip16
Last active April 11, 2024 07:51
Show Gist options
  • Save Ruchip16/c0a3631fe6d9cca9f2422564b21278f2 to your computer and use it in GitHub Desktop.
Save Ruchip16/c0a3631fe6d9cca9f2422564b21278f2 to your computer and use it in GitHub Desktop.
1. ios_vrf_global without AF configs
module: ios_vrf_global
short_description: Resource module to configure VRF definitions.
description: This module provides declarative management of VRF definitions on Cisco IOS.
version_added: 7.0.0
author: Ruchi Pakhle (@Ruchip16)
notes:
- Tested against Cisco IOSXE version 17.3 on CML.
- This module works with connection C(network_cli).
See U(https://docs.ansible.com/ansible/latest/network/user_guide/platform_ios.html)
options:
config:
description: A list of device configurations for VRF.
type: list
elements: dict
suboptions:
name:
description: Name of the VRF.
type: str
required: true
description:
description: VRF specific description
type: str
ipv4:
description: VRF IPv4 configuration
type: dict
suboptions:
multicast:
description: IP Multicast configuration
type: bool
ipv6:
description: VRF IPv6 configuration
type: dict
suboptions:
multicast:
description: IP Multicast configuration
type: bool
rd:
description: Specify Route Distinguisher (RD).
type: str
route_target:
description: Specify Target VPN Extended Communities.
type: dict
suboptions:
export:
description: Export Target-VPN community.
type: str
import_config:
description: Export Target-VPN community.
type: str
both:
description: Both export and import Target-VPN community
type: str
vnet:
description: Virtual NETworking configuration.
type: dict
suboptions:
tag:
description: Identifier used to tag packets associated with this VNET
type: int
vpn:
description: Configure VPN ID for the VRF as specified in RFC 2685
type: dict
suboptions:
id:
description: Configure VPN ID in RFC 2685 format
type: str
running_config:
description:
- This option is used only with state I(parsed).
- The value of this option should be the output received from the IOS device by
executing the command B(show running-config vrf).
- The state I(parsed) reads the configuration from C(running_config) option and
transforms it into Ansible structured data as per the resource module's argspec
and the value is then returned in the I(parsed) key within the result.
type: str
state:
choices: [parsed, gathered, deleted, merged, replaced, rendered, overridden]
default: merged
description:
- The state the configuration should be left in
- The states I(rendered), I(gathered) and I(parsed) does not perform any change
on the device.
- The state I(rendered) will transform the configuration in C(config) option to
platform specific CLI commands which will be returned in the I(rendered) key
within the result. For state I(rendered) active connection to remote host is
not required.
- The state I(gathered) will fetch the running configuration from device and transform
it into structured data in the format as per the resource module argspec and
the value is returned in the I(gathered) key within the result.
- The state I(parsed) reads the configuration from C(running_config) option and
transforms it into JSON format as per the resource module parameters and the
value is returned in the I(parsed) key within the result. The value of C(running_config)
option should be the same format as the output of command I(show running-config vrf).
connection to remote host is not required.
type: str
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment