• 博客
  • Ansible 社区论坛
  • 文档
Ansible Logo
Ansible 社区文档
Ansible

Ansible 入门

  • Ansible 入门指南
  • 执行环境入门指南

安装、升级和配置

  • 安装指南
  • Ansible 移植指南

使用 Ansible

  • 构建 Ansible 清单
  • 使用 Ansible 命令行工具
  • 使用 Ansible playbook
  • 使用 Ansible vault 保护敏感数据
  • 使用 Ansible 模块和插件
  • 使用 Ansible 集合
  • 在 Windows 和 BSD 上使用 Ansible
  • Ansible 提示和技巧

为 Ansible 贡献代码

  • Ansible 社区指南
  • Ansible 集合贡献者指南
  • ansible-core 贡献者指南
  • 高级贡献者指南
  • Ansible 文档样式指南

扩展 Ansible

  • 开发者指南

常见的 Ansible 场景

  • 旧版公共云指南

网络自动化

  • 网络入门
  • 网络高级主题
  • 网络开发者指南

Ansible Galaxy

  • Galaxy 用户指南
  • Galaxy 开发者指南

参考和附录

  • 集合索引
    • Amazon 命名空间中的集合
    • Ansible 命名空间中的集合
    • Arista 命名空间中的集合
    • AWX 命名空间中的集合
    • Azure 命名空间中的集合
    • Check_point 命名空间中的集合
    • Chocolatey 命名空间中的集合
    • Cisco 命名空间中的集合
    • Cloud 命名空间中的集合
    • Cloudscale_ch 命名空间中的集合
    • Community 命名空间中的集合
      • Community.Aws
      • Community.Ciscosmb
      • Community.Crypto
      • Community.Digitalocean
      • Community.Dns
      • Community.Docker
      • Community.General
      • Community.Grafana
      • Community.Hashi_Vault
      • Community.Hrobot
      • Community.Library_Inventory_Filtering_V1
      • Community.Libvirt
      • Community.Mongodb
      • Community.Mysql
      • Community.Network
        • 描述
        • 插件索引
      • Community.Okd
      • Community.Postgresql
      • Community.Proxysql
      • Community.Rabbitmq
      • Community.Routeros
      • Community.Sap_Libs
      • Community.Sops
      • Community.Vmware
      • Community.Windows
      • Community.Zabbix
    • Containers 命名空间中的集合
    • Cyberark 命名空间中的集合
    • Dellemc 命名空间中的集合
    • F5networks 命名空间中的集合
    • Fortinet 命名空间中的集合
    • Frr 命名空间中的集合
    • Gluster 命名空间中的集合
    • Google 命名空间中的集合
    • Grafana 命名空间中的集合
    • Hetzner 命名空间中的集合
    • Hpe 命名空间中的集合
    • Ibm 命名空间中的集合
    • Ieisystem 命名空间中的集合
    • Infinidat 命名空间中的集合
    • Infoblox 命名空间中的集合
    • Inspur 命名空间中的集合
    • Junipernetworks 命名空间中的集合
    • Kaytus 命名空间中的集合
    • Kubernetes 命名空间中的集合
    • Kubevirt 命名空间中的集合
    • Lowlydba 命名空间中的集合
    • Mellanox 命名空间中的集合
    • Microsoft 命名空间中的集合
    • Netapp 命名空间中的集合
    • Netapp_eseries 命名空间中的集合
    • Netbox 命名空间中的集合
    • Ngine_io 命名空间中的集合
    • Openstack 命名空间中的集合
    • Openvswitch 命名空间中的集合
    • Ovirt 命名空间中的集合
    • Purestorage 命名空间中的集合
    • Sensu 命名空间中的集合
    • Servicenow 命名空间中的集合
    • Splunk 命名空间中的集合
    • T_systems_mms 命名空间中的集合
    • Telekom_mms 命名空间中的集合
    • Theforeman 命名空间中的集合
    • Vmware 命名空间中的集合
    • Vultr 命名空间中的集合
    • Vyos 命名空间中的集合
    • Wti 命名空间中的集合
  • 所有模块和插件的索引
  • Playbook 关键词
  • 返回值
  • Ansible 配置设置
  • 控制 Ansible 的行为:优先级规则
  • YAML 语法
  • Python 3 支持
  • 解释器发现
  • 发行版和维护
  • 测试策略
  • 健全性测试
  • 常见问题
  • 词汇表
  • Ansible 参考:模块实用程序
  • 特殊变量
  • Red Hat Ansible Automation Platform
  • Ansible Automation Hub
  • 记录 Ansible 输出

路线图

  • Ansible 路线图
  • ansible-core 路线图




Ansible
  • 集合索引
  • Community 命名空间中的集合
  • Community.Network
  • community.network.ce_link_status 模块 – 获取华为 CloudEngine 交换机的接口链路状态。


community.network.ce_link_status 模块 – 获取华为 CloudEngine 交换机的接口链路状态。

注意

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

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

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

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

注意

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

  • 已弃用

  • 概要

  • 参数

  • 备注

  • 示例

  • 返回值

  • 状态

已弃用

在以下版本中移除:

6.0.0 版本

原因:

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

替代方案:

未知。

概要

  • 获取华为 CloudEngine 交换机的接口链路状态。

别名:network.cloudengine.ce_link_status

参数

参数

注释

interface

字符串 / 必需

对于 interface 参数,您可以输入 all 来显示所有接口的信息,输入接口类型(例如 40GE)来显示指定类型接口的信息,或输入接口的全名(例如 40GE1/0/22 或 vlanif10)来显示特定接口的信息。

备注

注意

  • 当前物理状态显示接口的物理状态。

  • 当前链路状态显示接口的链路层协议状态。

  • 当前 IPv4 状态显示接口的 IPv4 协议状态。

  • 当前 IPv6 状态显示接口的 IPv6 协议状态。

  • 入站字节数显示接口接收的字节数。

  • 入站单播数据包数显示接口接收的单播数据包数。

  • 入站组播数据包数显示接口接收的组播数据包数。

  • 入站广播数据包数显示接口接收的广播数据包数。

  • 入站错误数据包数显示接口接收的错误数据包数。

  • 入站丢弃数据包数显示发送到接口但被接口丢弃的数据包总数。

  • 入站速率(字节/秒) 显示接口在一定时间内接收字节的速率。

  • 入站速率(数据包/秒) 显示接口在一定时间内接收数据包的速率。

  • 出站字节数显示接口发送的字节数。

  • 出站单播数据包数显示接口发送的单播数据包数。

  • 出站组播数据包数显示接口发送的组播数据包数。

  • 出站广播数据包数显示接口发送的广播数据包数。

  • 出站错误数据包数显示接口发送但被远程接口丢弃的数据包总数。

  • 出站丢弃数据包数显示接口发送的丢弃数据包数。

  • 出站速率(字节/秒) 显示接口在一定时间内发送字节的速率。

  • 出站速率(数据包/秒) 显示接口在一定时间内发送数据包的速率。

  • 速度显示以太网接口的速率。

  • 此模块要求在被管理的远程设备上启用 netconf 系统服务。

  • 推荐连接方式为 netconf。

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

示例

- name: Link status 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: Get specified interface link status information
    community.network.ce_link_status:
      interface: 40GE1/0/1
      provider: "{{ cli }}"

  - name: Get specified interface type link status information
    community.network.ce_link_status:
      interface: 40GE
      provider: "{{ cli }}"

  - name: Get all interfaces link status information
    community.network.ce_link_status:
      interface: all
      provider: "{{ cli }}"

返回值

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

键

描述

result

字典

接口链路状态信息

返回:始终

示例: {"40ge2/0/8": {"当前IPv4状态": "down", "当前IPv6状态": "down", "当前链路状态": "up", "当前物理状态": "up", "入站广播(包)": "0", "入站丢弃(包)": "0", "入站错误(包)": "0", "入站组播(包)": "20151", "入站字节(字节)": "7314813", "入站速率(字节/秒)": "11", "入站速率(包/秒)": "0", "入站单播(包)": "0", "出站广播(包)": "1", "出站丢弃(包)": "0", "出站错误(包)": "0", "出站组播(包)": "20152", "出站字节(字节)": "7235021", "出站速率(字节/秒)": "11", "出站速率(包/秒)": "0", "出站单播(包)": "0", "速度": "40GE"}}

状态

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

  • 更多信息请参见 已弃用。

作者

  • 周志金 (@QijunPan)

资源链接

  • 问题追踪器
  • 代码仓库
上一页 下一页

© 版权所有 Ansible 项目贡献者。 上次更新于 2024年12月19日。