.. _vyos.rest.vyos_facts_module: ******************** vyos.rest.vyos_facts ******************** **Get facts about VyOS devices using REST API** Version added: 1.0.0 .. contents:: :local: :depth: 1 Synopsis -------- - Collects facts from VyOS devices via the REST API. - Returns structured facts under the ``ansible_facts`` key. - Uses REST API (``connection=httpapi``) instead of CLI. Parameters ---------- .. raw:: html
Parameter Choices/Defaults Comments
gather_network_resources
list / elements=string
When supplied, this argument will restrict the facts collected to a given subset. Possible values include the resource module names.
This argument is not currently used.
gather_subset
list / elements=string
Default:
["default"]
When supplied, this argument will restrict the facts collected to a given subset. Possible values for this argument include all, default, config, interfaces, hostname, users, bgp, ospf, ntp, snmp and logging.
Specify a list of values to include a larger subset. Use the exclamation mark (!) before a value to exclude it. Values all and default cannot be combined with each other or with negation.

Notes ----- .. note:: - Requires ``ansible_connection=httpapi`` with the VyOS httpapi plugin. - ``ansible_network_os`` must be set to ``vyos.rest.vyos``. - Only configuration facts are available via the REST API. Operational state (interface counters, BGP neighbors) is not supported. Examples -------- .. code-block:: yaml - name: Gather all facts vyos.rest.vyos_facts: gather_subset: all - name: Gather default facts vyos.rest.vyos_facts: - name: Gather interface and hostname facts only vyos.rest.vyos_facts: gather_subset: - interfaces - hostname - name: Gather all except config vyos.rest.vyos_facts: gather_subset: - all - '!config' Returned Facts -------------- Facts returned by this module are added/updated in the ``hostvars`` host facts and can be referenced by name just like any other host fact. They do not need to be registered in order to use them. .. raw:: html
Fact Returned Description
vyos_bgp
dictionary
BGP configuration.

vyos_config
dictionary
Full device configuration as structured data.

vyos_hostname
string
Device hostname.

vyos_interfaces
dictionary
Interface configuration.

vyos_logging
dictionary
Logging configuration.

vyos_ntp
dictionary
NTP configuration.

vyos_ospf
dictionary
OSPFv2 configuration.

vyos_ospfv3
dictionary
OSPFv3 configuration.

vyos_snmp
dictionary
SNMP configuration.

vyos_users
list
User accounts (without passwords).



Status ------ Authors ~~~~~~~ - VyOS Community (@vyos)