community.network.edgeswitch_facts 模块 – 从运行 Edgeswitch 的远程设备收集信息

注意

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

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

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

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

注意

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

已弃用

移除版本:

6.0.0 版本

原因:

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

替代方案:

未知。

概要

  • 从运行 Ubiquiti Edgeswitch 的远程设备收集基本设备信息。此模块会在所有基本网络信息键前加上 ansible_net_<信息>。信息模块将始终从设备收集基本信息集,并可以启用或禁用其他信息的收集。

别名:network.edgeswitch.edgeswitch_facts

参数

参数

注释

gather_subset

字符串

当提供时,此参数将限制收集的信息为给定的子集。此参数的可能值包括 all、config 和 interfaces。可以指定一个值列表以包含更大的子集。这些值也可以与初始 ! 一起使用,以指定不应收集特定的子集。

默认值: "!config"

注意

注意

  • 已在 Edgeswitch 1.7.4 上测试

示例

- name: Collect all facts from the device
  community.network.edgeswitch_facts:
    gather_subset: all

- name: Collect only the running config and default facts
  community.network.edgeswitch_facts:
    gather_subset:
      - config

返回值

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

描述

ansible_net_config

字符串

来自设备的当前活动配置

返回: 当配置配置时

ansible_net_gather_subset

列表 / 元素=字符串

从设备收集的信息子集列表

返回: 始终

ansible_net_hostname

字符串

设备的配置主机名

返回: 始终

ansible_net_interfaces

字典

系统上运行的所有接口的哈希

返回: 当接口配置时

ansible_net_model

字符串

从设备返回的型号名称

返回: 始终

ansible_net_serialnum

字符串

远程设备的序列号

返回: 始终

ansible_net_startupconfig

字符串

在 community.network 1.2.0 中添加

来自设备的启动配置

返回: 当配置配置时

ansible_net_version

字符串

在远程设备上运行的操作系统版本

返回: 始终

状态

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

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

作者

  • Frederic Bor (@f-bor)