community.network.ce_mtu 模块 – 管理华为 CloudEngine 交换机的 MTU 设置。

注意

此模块是 community.network 集合 (版本 5.1.0) 的一部分。

如果您使用的是 ansible 包,则可能已安装此集合。它不包含在 ansible-core 中。要检查它是否已安装,请运行 ansible-galaxy collection list

要安装它,请使用: ansible-galaxy collection install community.network

要在 playbook 中使用它,请指定: community.network.ce_mtu

注意

community.network 集合已弃用,并将从 Ansible 12 中移除。有关更多信息,请参阅 讨论主题

已弃用

在以下版本中移除:

6.0.0 版本

原因:

此集合及其中的所有内容均未维护且已弃用。

替代方案:

未知。

概要

  • 管理华为 CloudEngine 交换机的 MTU 设置。

别名:network.cloudengine.ce_mtu

参数

参数

注释

interface

字符串

接口的全名,例如 40GE1/0/22。

jumbo_max

字符串

最大帧大小。默认值为 9216。该值是一个整数,以字节为单位。对于 CE12800,取值范围为 1536 到 12224;对于 ToR 交换机,取值范围为 1536 到 12288。

jumbo_min

字符串

非巨型帧大小阈值。默认值为 1518。该值是一个整数,范围为 1518 到 jumbo_max,以字节为单位。

mtu

字符串

特定接口的 MTU。该值是一个整数,范围为 46 到 9600,以字节为单位。

state

字符串

指定资源的所需状态。

选项

  • "present" ← (默认)

  • "absent"

备注

注意

  • 需要 sysmtu 参数,或者需要 interfacemtu 参数。

  • state=absent 如果当前存在给定的 MTU 值,则将其取消配置。

  • 推荐的连接方式是 network_cli

  • 此模块也适用于旧版 playbook 的 local 连接。

示例

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

  tasks:

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

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

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

  - name: "Config mtu and jumboframe on 40GE1/0/22 (routed interface)"
    community.network.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"
    community.network.ce_mtu:
      state: absent
      interface: 40GE1/0/22
      provider: "{{ cli }}"

返回值

此处记录了常见的返回值 此处,以下是此模块特有的字段

描述

changed

布尔值

检查设备上是否进行了更改

返回:始终

示例: true

end_state

字典

模块执行后 mtu/sysmtu 值的键值对

返回:始终

示例: {"jumbo_max": "9000", "jumbo_min": "8000", "mtu": "1700"}

existing

字典

接口/系统上现有 mtu/sysmtu 的键值对

返回:始终

示例: {"jumbo_max": "9216", "jumbo_min": "1518", "mtu": "1600"}

proposed

字典

传递给模块的参数的键值对

返回:始终

示例: {"jumbo_max": "9000", "jumbo_min": "8000", "mtu": "1700"}

updates

列表 / 元素=字符串

发送到设备的命令

返回:始终

示例: ["interface 40GE1/0/23", "mtu 1700", "jumboframe enable 9000 8000"]

状态

  • 此模块将在 6.0.0 版本中移除。[已弃用]

  • 有关更多信息,请参阅 已弃用

作者

  • QijunPan (@QijunPan)