cisco.iosxr.iosxr_facts 模块 – 用于从远程设备收集信息的模块。

注意

此模块是 cisco.iosxr 集合(版本 10.2.2)的一部分。

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

要安装它,请使用: ansible-galaxy collection install cisco.iosxr

要在剧本中使用它,请指定: cisco.iosxr.iosxr_facts

cisco.iosxr 1.0.0 中的新增功能

概要

  • 从运行 iosxr 操作系统的网络设备收集信息。此模块将收集的信息放置在以各自资源名称为键的事实树中。事实模块将始终从设备收集一组基本事实,并且可以启用或禁用收集其他事实。

参数

参数

注释

available_network_resources

boolean

当为 “True” 时,将提供可用的资源模块的网络资源列表。

选择

  • false ←(默认)

  • true

gather_network_resources

list / elements=string

当提供此参数时,它会将收集的事实限制为给定的子集。此参数的可能值包括 all 和诸如 interfaces、lacp 等资源。可以指定一个值列表来包含更大的子集。值也可以与初始 ! 一起使用,以指定不应收集特定的子集。有效的子集是 ‘all’、‘lacp’、‘lacp_interfaces’、‘lldp_global’、‘lldp_interfaces’、‘interfaces’、‘l2_interfaces’、‘l3_interfaces’、‘lag_interfaces’、‘acls’、‘acl_interfaces’、‘static_routes’、‘ospfv2’。

gather_subset

list / elements=string

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

默认值: ["min"]

注释

注意

示例

# Gather all facts
- cisco.iosxr.iosxr_facts:
    gather_subset: all
    gather_network_resources: all

# Collect only the config and default facts
- cisco.iosxr.iosxr_facts:
    gather_subset:
      - config

# Do not collect hardware facts
- cisco.iosxr.iosxr_facts:
    gather_subset:
      - '!hardware'

# Collect only the lacp facts
- cisco.iosxr.iosxr_facts:
    gather_subset:
      - '!all'
      - '!min'
    gather_network_resources:
      - lacp

# Do not collect lacp_interfaces facts
- cisco.iosxr.iosxr_facts:
    gather_network_resources:
      - '!lacp_interfaces'

# Collect lacp and minimal default facts
- cisco.iosxr.iosxr_facts:
    gather_subset: min
    gather_network_resources: lacp

# Collect only the interfaces facts
- cisco.iosxr.iosxr_facts:
    gather_subset:
      - '!all'
      - '!min'
    gather_network_resources:
      - interfaces
      - l2_interfaces

返回值

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

描述

ansible_net_all_ipv4_addresses

list / elements=string

设备上配置的所有 IPv4 地址

已返回:当配置了接口时

ansible_net_all_ipv6_addresses

list / elements=string

设备上配置的所有 IPv6 地址

已返回:当配置了接口时

ansible_net_api

string

传输的名称

已返回:始终

ansible_net_config

string

来自设备的当前活动配置

已返回:当配置了 config 时

ansible_net_cpu_utilization

dictionary

设备的当前 CPU 利用率

已返回:当配置了硬件时

ansible_net_filesystems

list / elements=string

设备上可用的所有文件系统名称

已返回:当配置了硬件时

ansible_net_gather_network_resources

list / elements=string

从设备收集的事实资源子集列表

已返回:始终

ansible_net_gather_subset

list / elements=string

从设备收集的事实子集列表

已返回:始终

ansible_net_hostname

string

设备的配置主机名

已返回:始终

ansible_net_image

string

设备正在运行的映像文件

已返回:始终

ansible_net_interfaces

dictionary

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

已返回:当配置了接口时

ansible_net_memfree_mb

integer

远程设备上可用的可用内存,单位为 Mb

已返回:当配置了硬件时

ansible_net_memtotal_mb

integer

远程设备上的总内存,单位为 Mb

已返回:当配置了硬件时

ansible_net_model

string

从设备返回的型号名称

已返回:始终

ansible_net_neighbors

dictionary

来自远程设备的 LLDP 和 CDP 邻居列表。如果一个端口上同时存在 CDP 和 LLDP 邻居数据,则优先选择 CDP。

已返回:当配置了接口时

ansible_net_python_version

string

Ansible 控制器正在使用的 Python 版本

已返回:始终

ansible_net_version

string

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

已返回:始终

作者

  • Ricardo Carrillo Cruz (@rcarrillocruz)

  • Nilashish Chakraborty (@Nilashishc)