New in version 2.4.
The below requirements are needed on the host that executes this module.
Parameter |
Choices/Defaults |
Comments |
---|---|---|
active
(added in 2.5) |
|
Whether the interface is
active or preconfigured . Preconfiguration allows you to configure modular services cards before they are inserted into the router. When the cards are inserted, they are instantly configured. Active cards are the ones already inserted. |
aggregate
|
|
List of Interface definitions. Include multiple interface configurations together, one each on a seperate line
|
delay
|
Default:
10
|
Time in seconds to wait before checking for the operational state on remote device. This wait is applicable for operational state argument which are state with values
up /down , tx_rate and rx_rate. |
description
|
|
Description of Interface being configured.
|
duplex
|
|
Configures the interface duplex mode. Default is auto-negotiation when not configured.
|
enabled
|
|
Removes the shutdown configuration, which removes the forced administrative down on the interface, enabling it to move to an up or down state.
|
mtu
|
|
Sets the MTU value for the interface. Range is between 64 and 65535'
|
name
required |
|
Name of the interface to configure in
type + path format. e.g. GigabitEthernet0/0/0/0 |
provider
|
|
Deprecated
Starting with Ansible 2.5 we recommend using
connection: network_cli .For more information please see the Network Guide.
A dict object containing connection details.
|
username
|
|
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
ANSIBLE_NET_USERNAME will be used instead. |
host
required |
|
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.
|
ssh_keyfile
|
|
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
ANSIBLE_NET_SSH_KEYFILE will be used instead. |
timeout
|
Default:
10
|
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.
|
password
|
|
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
ANSIBLE_NET_PASSWORD will be used instead. |
port
|
Default:
22
|
Specifies the port to use when building the connection to the remote device.
|
rx_rate
|
|
Receiver rate in bits per second (bps).
This is state check parameter only.
Supports conditionals, see Conditionals in Networking Modules
|
speed
|
|
Configure the speed for an interface. Default is auto-negotiation when not configured.
|
state
|
|
State of the Interface configuration,
up means present and operationally up and down means present and operationally down |
tx_rate
|
|
Transmit rate in bits per second (bps).
This is state check parameter only.
Supports conditionals, see Conditionals in Networking Modules
|
Note
- name: configure interface
iosxr_interface:
name: GigabitEthernet0/0/0/2
description: test-interface
speed: 100
duplex: half
mtu: 512
- name: remove interface
iosxr_interface:
name: GigabitEthernet0/0/0/2
state: absent
- name: make interface up
iosxr_interface:
name: GigabitEthernet0/0/0/2
enabled: True
- name: make interface down
iosxr_interface:
name: GigabitEthernet0/0/0/2
enabled: False
- name: Create interface using aggregate
iosxr_interface:
aggregate:
- name: GigabitEthernet0/0/0/3
- name: GigabitEthernet0/0/0/2
speed: 100
duplex: full
mtu: 512
state: present
- name: Create interface using aggregate along with additional params in aggregate
iosxr_interface:
aggregate:
- { name: GigabitEthernet0/0/0/3, description: test-interface 3 }
- { name: GigabitEthernet0/0/0/2, description: test-interface 2 }
speed: 100
duplex: full
mtu: 512
state: present
- name: Delete interface using aggregate
iosxr_interface:
aggregate:
- name: GigabitEthernet0/0/0/3
- name: GigabitEthernet0/0/0/2
state: absent
- name: Check intent arguments
iosxr_interface:
name: GigabitEthernet0/0/0/5
state: up
delay: 20
- name: Config + intent
iosxr_interface:
name: GigabitEthernet0/0/0/5
enabled: False
state: down
delay: 20
Common return values are documented here, the following are the fields unique to this module:
Key |
Returned |
Description |
---|---|---|
commands
list
|
always (empty list when no commands to send) |
The list of configuration mode commands sent to device with transport
cli Sample:
['interface GigabitEthernet0/0/0/2', 'description test-interface', 'duplex half', 'mtu 512']
|
xml
list
|
always (empty list when no xml rpc to send) |
NetConf rpc xml sent to device with transport
netconf Sample:
['<config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0"> <interface-configurations xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-ifmgr-cfg"> <interface-configuration xc:operation="merge"> <active>act</active> <interface-name>GigabitEthernet0/0/0/0</interface-name> <description>test-interface-0</description> <mtus><mtu> <owner>GigabitEthernet</owner> <mtu>512</mtu> </mtu></mtus> <ethernet xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-drivers-media-eth-cfg"> <speed>100</speed> <duplex>half</duplex> </ethernet> </interface-configuration> </interface-configurations></config>']
|
This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.
For more information about Red Hat’s support of this module, please refer to this Knowledge Base article
Hint
If you notice any issues in this documentation you can edit this document to improve it.