ansible / ansible.builtin / v2.5.10 / module / ios_vrf Manage the collection of VRF definitions on Cisco IOS devices | "added in version" 2.3 of ansible.builtin" Authors: Peter Sprygada (@privateip) preview | supported by networkansible.builtin.ios_vrf (v2.5.10) — module
pip
Install with pip install ansible==2.5.10
This module provides declarative management of VRF definitions on Cisco IOS devices. It allows playbooks to manage individual or the entire VRF collection. It also supports purging VRF definitions from the configuration that are not explicitly defined.
- name: configure a vrf named management ios_vrf: name: management description: oob mgmt vrf interfaces: - Management1
- name: remove a vrf named test ios_vrf: name: test state: absent
- name: configure set of VRFs and purge any others ios_vrf: vrfs: - red - blue - green purge: yes
- name: Creates a list of import RTs for the VRF with the same parameters ios_vrf: name: test_import rd: 1:100 route_import: - 1:100 - 3:100
- name: Creates a list of export RTs for the VRF with the same parameters ios_vrf: name: test_export rd: 1:100 route_export: - 1:100 - 3:100
- name: Creates a list of import and export route targets for the VRF with the same parameters ios_vrf: name: test_both rd: 1:100 route_both: - 1:100 - 3:100
rd: description: - The router-distinguisher value uniquely identifies the VRF to routing processes on the remote IOS system. The RD value takes the form of C(A:B) where C(A) and C(B) are both numeric values. name: description: - The name of the VRF definition to be managed on the remote IOS device. The VRF definition name is an ASCII string name used to uniquely identify the VRF. This argument is mutually exclusive with the C(vrfs) argument vrfs: description: - The set of VRF definition objects to be configured on the remote IOS device. Ths list entries can either be the VRF name or a hash of VRF definitions and attributes. This argument is mutually exclusive with the C(name) argument. delay: default: 10 description: - Time in seconds to wait before checking for the operational state on remote device. version_added: '2.4' version_added_collection: ansible.builtin purge: default: false description: - Instructs the module to consider the VRF definition absolute. It will remove any previously configured VRFs on the device. state: choices: - present - absent default: present description: - Configures the state of the VRF definition as it relates to the device operational configuration. When set to I(present), the VRF should be configured in the device active configuration and when set to I(absent) the VRF should not be in the device active configuration provider: description: - B(Deprecated) - 'Starting with Ansible 2.5 we recommend using C(connection: network_cli).' - For more information please see the U(https://docs.ansible.com/ansible/latest/network/user_guide/platform_ios.html). - HORIZONTALLINE - A dict object containing connection details. suboptions: auth_pass: description: - Specifies the password to use if required to enter privileged mode on the remote device. If I(authorize) is false, then this argument does nothing. If the value is not specified in the task, the value of environment variable C(ANSIBLE_NET_AUTH_PASS) will be used instead. type: str authorize: default: false description: - Instructs the module to enter privileged mode on the remote device before sending any commands. If not specified, the device will attempt to execute all commands in non-privileged mode. If the value is not specified in the task, the value of environment variable C(ANSIBLE_NET_AUTHORIZE) will be used instead. type: bool host: description: - Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. type: str password: description: - Specifies the password to use to authenticate the connection to the remote device. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable C(ANSIBLE_NET_PASSWORD) will be used instead. type: str port: description: - Specifies the port to use when building the connection to the remote device. type: int ssh_keyfile: description: - Specifies the SSH key to use to authenticate the connection to the remote device. This value is the path to the key used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable C(ANSIBLE_NET_SSH_KEYFILE) will be used instead. type: path timeout: description: - Specifies the timeout in seconds for communicating with the network device for either connecting or sending commands. If the timeout is exceeded before the operation is completed, the module will error. type: int username: description: - Configures the username to use to authenticate the connection to the remote device. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable C(ANSIBLE_NET_USERNAME) will be used instead. type: str type: dict interfaces: description: - Identifies the set of interfaces that should be configured in the VRF. Interfaces must be routed interfaces in order to be placed into a VRF. route_both: description: - Adds an export and import list of extended route target communities to the VRF. version_added: '2.5' version_added_collection: ansible.builtin description: description: - Provides a short description of the VRF definition in the current active configuration. The VRF definition value accepts alphanumeric characters used to provide additional information about the VRF. route_export: description: - Adds an export list of extended route target communities to the VRF. version_added: '2.5' version_added_collection: ansible.builtin route_import: description: - Adds an import list of extended route target communities to the VRF. version_added: '2.5' version_added_collection: ansible.builtin associated_interfaces: description: - This is a intent option and checks the operational state of the for given vrf C(name) for associated interfaces. If the value in the C(associated_interfaces) does not match with the operational state of vrf interfaces on device it will result in failure. version_added: '2.5' version_added_collection: ansible.builtin
commands: description: The list of configuration mode commands to send to the device returned: always sample: - vrf definition ansible - description management vrf - rd: 1:100 type: list delta: description: The time elapsed to perform all operations returned: always sample: '0:00:10.469466' type: str end: description: The time the job ended returned: always sample: '2016-11-16 10:38:25.595612' type: str start: description: The time the job started returned: always sample: '2016-11-16 10:38:15.126146' type: str