ansible.netcommon.net_interface module – (deprecated, removed after 2022-06-01) Manage Interface on network devices
Note
This module is part of the ansible.netcommon collection (version 2.6.1).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install ansible.netcommon
.
To use it in a playbook, specify: ansible.netcommon.net_interface
.
New in version 1.0.0: of ansible.netcommon
DEPRECATED
- Removed in
major release after 2022-06-01
- Why
Updated modules released with more functionality
- Alternative
Use platform-specific “[netos]_interfaces” module
Synopsis
This module provides declarative management of Interfaces on network devices.
Note
This module has a corresponding action plugin.
Parameters
Parameter |
Comments |
---|---|
List of Interfaces definitions. |
|
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 Default: 10 |
|
Description of Interface. |
|
Interface link status Choices:
|
|
Configure interface link status. |
|
Maximum size of transmit packet. |
|
Name of the Interface. |
|
Purge Interfaces not defined in the aggregate parameter. This applies only for logical interface. Default: “no” |
|
Receiver rate in bits per second (bps). This is state check parameter only. Supports conditionals, see Conditionals in Networking Modules |
|
Interface link speed. |
|
State of the Interface configuration, Choices:
|
|
Transmit rate in bits per second (bps). This is state check parameter only. Supports conditionals, see Conditionals in Networking Modules |
Notes
Note
This module is supported on
ansible_network_os
network platforms. See the Network Platform Options for details.
Examples
- name: configure interface
ansible.netcommon.net_interface:
name: ge-0/0/1
description: test-interface
- name: remove interface
ansible.netcommon.net_interface:
name: ge-0/0/1
state: absent
- name: make interface up
ansible.netcommon.net_interface:
name: ge-0/0/1
description: test-interface
enabled: true
- name: make interface down
ansible.netcommon.net_interface:
name: ge-0/0/1
description: test-interface
enabled: false
- name: Create interface using aggregate
ansible.netcommon.net_interface:
aggregate:
- {name: ge-0/0/1, description: test-interface-1}
- {name: ge-0/0/2, description: test-interface-2}
speed: 1g
duplex: full
mtu: 512
- name: Delete interface using aggregate
ansible.netcommon.net_interface:
aggregate:
- {name: ge-0/0/1}
- {name: ge-0/0/2}
state: absent
- name: Check intent arguments
ansible.netcommon.net_interface:
name: fxp0
state: up
tx_rate: ge(0)
rx_rate: le(0)
- name: Config + intent
ansible.netcommon.net_interface:
name: fxp0
enabled: false
state: down
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
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 20”, “name test-interface”] |
Status
This module will be removed in a major release after 2022-06-01. [deprecated]
For more information see DEPRECATED.
Authors
Ganesh Nalawade (@ganeshrn)