community.general.ce_mtu (0.1.1) — module

Manages MTU settings on HUAWEI CloudEngine switches.

Authors: QijunPan (@QijunPan)

preview | supported by community

Install collection

Install with ansible-galaxy collection install community.general:==0.1.1


Add to requirements.yml

  collections:
    - name: community.general
      version: 0.1.1

Description

Manages MTU settings on HUAWEI CloudEngine switches.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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 }}"

Inputs

    
mtu:
    description:
    - MTU for a specific interface. The value is an integer ranging from 46 to 9600, in
      bytes.

state:
    choices:
    - present
    - absent
    default: present
    description:
    - Specify desired state of the resource.

interface:
    description:
    - Full name of interface, i.e. 40GE1/0/22.

jumbo_max:
    description:
    - 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:
    description:
    - Non-jumbo frame size threshold. The default value is 1518. The value is an integer
      that ranges from 1518 to jumbo_max, in bytes.

Outputs

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