ansible.builtin.iosxr_interface (v2.4.6.0-1) — module

Manage Interface on Cisco IOS XR network devices

| "added in version" 2.4 of ansible.builtin"

Authors: Ganesh Nalawade (@ganeshrn)

preview | supported by network

Install Ansible via pip

Install with pip install ansible==2.4.6.0.post1

Description

This module provides declarative management of Interfaces on Cisco IOS XR network devices.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: configure interface
  iosxr_interface:
      name: GigabitEthernet0/0/0/2
      description: test-interface
      speed: 100
      duplex: half
      mtu: 512
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: remove interface
  iosxr_interface:
    name: GigabitEthernet0/0/0/2
    state: absent
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: make interface up
  iosxr_interface:
    name: GigabitEthernet0/0/0/2
    enabled: True
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: make interface down
  iosxr_interface:
    name: GigabitEthernet0/0/0/2
    enabled: False
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Delete interface using aggregate
  iosxr_interface:
    aggregate:
    - name: GigabitEthernet0/0/0/3
    - name: GigabitEthernet0/0/0/2
    state: absent
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Check intent arguments
  iosxr_interface:
    name: GigabitEthernet0/0/0/5
    state: up
    delay: 20
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Config + intent
  iosxr_interface:
    name: GigabitEthernet0/0/0/5
    enabled: False
    state: down
    delay: 20

Inputs

    
mtu:
    description:
    - Maximum size of transmit packet.

name:
    description:
    - Name of the Interface.
    required: true

delay:
    default: 10
    description:
    - Time in seconds to wait before checking for the operational state on remote device.
      This wait is applicable for operational state argument which are I(state) with values
      C(up)/C(down), I(tx_rate) and I(rx_rate).

speed:
    description:
    - Interface link speed.

state:
    choices:
    - present
    - absent
    - up
    - down
    default: present
    description:
    - State of the Interface configuration, C(up) means present and operationally up and
      C(down) means present and operationally C(down)

duplex:
    choices:
    - full
    - half
    description:
    - Interface link status

enabled:
    description:
    - Interface link status.

rx_rate:
    description:
    - Receiver rate in bits per second (bps).

tx_rate:
    description:
    - Transmit rate in bits per second (bps).

aggregate:
    description: List of Interfaces definitions.

description:
    description:
    - Description of Interface.

Outputs

commands:
  description: The list of configuration mode commands to send to the device.
  returned: always, except for the platforms that use Netconf transport to manage
    the device.
  sample:
  - interface GigabitEthernet0/0/0/2
  - description test-interface
  - duplex half
  - mtu 512
  type: list