W3cubDocs

/Ansible

ce_mtu - Manages MTU settings on HUAWEI CloudEngine switches.

New in version 2.4.

Synopsis

  • Manages MTU settings on HUAWEI CloudEngine switches.

Options

parameter required default choices comments
interface
no
Full name of interface, i.e. 40GE1/0/22.
jumbo_max
no
Maximum frame size. The default value is 9216. The value is an integer and expressed in bytes. The value range is 1536 to 12224 for the CE12800 and 1536 to 12288 for ToR switches.
jumbo_min
no
Non-jumbo frame size threshod. The default value is 1518. The value is an integer that ranges from 1518 to jumbo_max, in bytes.
mtu
no
MTU for a specific interface. The value is an integer ranging from 46 to 9600, in bytes.
state
no present
  • present
  • absent
Specify desired state of the resource.

Examples

- name: Mtu test
  hosts: cloudengine
  connection: local
  gather_facts: no
  vars:
    cli:
      host: "{{ inventory_hostname }}"
      port: "{{ ansible_ssh_port }}"
      username: "{{ username }}"
      password: "{{ password }}"
      transport: cli

  tasks:

  - name: "Config jumboframe on 40GE1/0/22"
    ce_mtu:
      interface: 40GE1/0/22
      jumbo_max: 9000
      jumbo_min: 8000
      provider: "{{ cli }}"

  - name: "Config mtu on 40GE1/0/22 (routed interface)"
    ce_mtu:
      interface: 40GE1/0/22
      mtu: 1600
      provider: "{{ cli }}"

  - name: "Config mtu on 40GE1/0/23 (switched interface)"
    ce_mtu:
      interface: 40GE1/0/22
      mtu: 9216
      provider: "{{ cli }}"

  - name: "Config mtu and jumboframe on 40GE1/0/22 (routed interface)"
    ce_mtu:
      interface: 40GE1/0/22
      mtu: 1601
      jumbo_max: 9001
      jumbo_min: 8001
      provider: "{{ cli }}"

  - name: "Unconfigure mtu and jumboframe on a given interface"
    ce_mtu:
      state: absent
      interface: 40GE1/0/22
      provider: "{{ cli }}"

Return Values

Common return values are documented here Return Values, the following are the fields unique to this module:

name description returned type sample
end_state
k/v pairs of mtu/sysmtu values after module execution
always dict {'jumbo_max': '9000', 'jumbo_min': '8000', 'mtu': '1700'}
changed
check to see if a change was made on the device
always boolean True
updates
command sent to the device
always list ['interface 40GE1/0/23', 'mtu 1700', 'jumboframe enable 9000 8000']
proposed
k/v pairs of parameters passed into module
always dict {'jumbo_max': '9000', 'jumbo_min': '8000', 'mtu': '1700'}
existing
k/v pairs of existing mtu/sysmtu on the interface/system
always dict {'jumbo_max': '9216', 'jumbo_min': '1518', 'mtu': '1600'}

Notes

Note

  • Either sysmtu param is required or interface AND mtu params are req’d.
  • state=absent unconfigures a given MTU if that value is currently present.

Status

This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.

For help in developing on modules, should you be so inclined, please read Community Information & Contributing, Testing Ansible and Developing Modules.

© 2012–2017 Michael DeHaan
© 2017 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/ce_mtu_module.html