ansible / ansible.builtin / v2.8.11 / module / cnos_interface Manage Interface on Lenovo CNOS network devices | "added in version" 2.3 of ansible.builtin" Authors: Anil Kumar Muraleedharan(@amuraleedhar) preview | supported by communityansible.builtin.cnos_interface (v2.8.11) — module
pip
Install with pip install ansible==2.8.11
This module provides declarative management of Interfaces on Lenovo CNOS network devices.
- name: configure interface cnos_interface: name: Ethernet1/33 description: test-interface speed: 100 duplex: half mtu: 999
- name: remove interface cnos_interface: name: loopback3 state: absent
- name: make interface up cnos_interface: name: Ethernet1/33 enabled: True
- name: make interface down cnos_interface: name: Ethernet1/33 enabled: False
- name: Check intent arguments cnos_interface: name: Ethernet1/33 state: up tx_rate: ge(0) rx_rate: le(0)
- name: Check neighbors intent arguments cnos_interface: name: Ethernet1/33 neighbors: - port: eth0 host: netdev
- name: Config + intent cnos_interface: name: Ethernet1/33 enabled: False state: down
- name: Add interface using aggregate cnos_interface: aggregate: - { name: Ethernet1/33, mtu: 256, description: test-interface-1 } - { name: Ethernet1/44, mtu: 516, description: test-interface-2 } duplex: full speed: 100 state: present
- name: Delete interface using aggregate cnos_interface: aggregate: - name: loopback3 - name: loopback6 state: absent
mtu: description: - Maximum size of transmit packet. version_added: '2.8' version_added_collection: ansible.builtin name: description: - Name of the Interface. required: true version_added: '2.8' version_added_collection: ansible.builtin delay: default: 20 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) version_added: '2.8' version_added_collection: ansible.builtin speed: description: - Interface link speed. version_added: '2.8' version_added_collection: ansible.builtin 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) version_added: '2.8' version_added_collection: ansible.builtin duplex: choices: - full - half - auto default: auto description: - Interface link status version_added: '2.8' version_added_collection: ansible.builtin enabled: default: true description: - Interface link status. type: bool version_added: '2.8' version_added_collection: ansible.builtin rx_rate: description: - Receiver rate in bits per second (bps). - This is state check parameter only. - Supports conditionals, see L(Conditionals in Networking Modules, ../network/user_guide/network_working_with_command_output.html) version_added: '2.8' version_added_collection: ansible.builtin tx_rate: description: - Transmit rate in bits per second (bps). - This is state check parameter only. - Supports conditionals, see L(Conditionals in Networking Modules, ../network/user_guide/network_working_with_command_output.html) version_added: '2.8' version_added_collection: ansible.builtin provider: description: - B(Deprecated) - 'Starting with Ansible 2.5 we recommend using C(connection: network_cli).' - For more information please see the L(CNOS Platform Options guide, ../network/user_guide/platform_cnos.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. authorize: default: 'no' 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. required: true 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. port: default: 22 description: - Specifies the port to use when building the connection to the remote device. 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. timeout: default: 10 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. 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. version_added: '2.8' version_added_collection: ansible.builtin aggregate: description: List of Interfaces definitions. version_added: '2.8' version_added_collection: ansible.builtin neighbors: description: - Check operational state of given interface C(name) for LLDP neighbor. - The following suboptions are available. suboptions: host: description: - LLDP neighbor host for given interface C(name). port: description: - LLDP neighbor port to which interface C(name) is connected. version_added: '2.8' version_added_collection: ansible.builtin description: description: - Description of Interface. version_added: '2.8' version_added_collection: ansible.builtin
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 Ethernet1/33 - description test-interface - duplex half - mtu 512 type: list