community.network.ce_netstream_template 模块 – 管理华为 CloudEngine 交换机上的 NetStream 模板配置。

注意

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

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

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

要在剧本中使用它,请指定:community.network.ce_netstream_template

注意

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

已弃用

在以下版本中移除:

版本 6.0.0

原因:

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

替代方案:

未知。

摘要

  • 管理华为 CloudEngine 交换机上的 NetStream 模板配置。

别名:network.cloudengine.ce_netstream_template

参数

参数

注释

collect_counter

字符串

配置发送到 NSC 的灵活流统计信息中包含的数据包和字节数。

选项

  • "bytes"

  • "packets"

collect_interface

字符串

配置发送到 NSC 的灵活流统计信息中包含的输入或输出接口。

选项

  • "input"

  • "output"

description

字符串

配置 netstream 记录的描述。值是一个 1 到 80 个字符的字符串(不区分大小写)。

match

字符串

配置灵活流统计模板关键字。

选项

  • "destination-address"

  • "destination-port"

  • "tos"

  • "protocol"

  • "source-address"

  • "source-port"

record_name

字符串

配置 netstream 记录的名称。值是一个 1 到 32 个字符的字符串(不区分大小写)。

state

字符串

指定资源的所需状态。

选项

  • "present" ← (默认)

  • "absent"

type

字符串 / 必需

配置 netstream 记录的类型。

选项

  • "ip"

  • "vxlan"

备注

注意

  • 推荐的连接是 network_cli

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

示例

- name: Netstream template module 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 ipv4 netstream record
    community.network.ce_netstream_template:
      state: present
      type: ip
      record_name: test
      provider: "{{ cli }}"
  - name: Undo ipv4 netstream record
    community.network.ce_netstream_template:
      state: absent
      type: ip
      record_name: test
      provider: "{{ cli }}"
  - name: Config ipv4 netstream record collect_counter
    community.network.ce_netstream_template:
      state: present
      type: ip
      record_name: test
      collect_counter: bytes
      provider: "{{ cli }}"
  - name: Undo ipv4 netstream record collect_counter
    community.network.ce_netstream_template:
      state: absent
      type: ip
      record_name: test
      collect_counter: bytes
      provider: "{{ cli }}"

返回值

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

描述

changed

布尔值

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

返回:始终

示例: true

end_state

字典

模块执行后 aaa 参数的键值对

返回:始终

示例: {"record_name": "test", "type": "ip"}

existing

字典

现有 aaa 服务器的键值对

返回:始终

示例: {}

proposed

字典

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

返回:始终

示例: {"record_name": "test", "state": "present", "type": "ip"}

updates

列表 / 元素=字符串

发送到设备的命令

返回:始终

示例: ["netstream record test ip"]

状态

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

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

作者

  • wangdezhuang (@QijunPan)