From 2d0804cc31aa2b0aa24bbd553f80ea84c9830fa7 Mon Sep 17 00:00:00 2001 From: omnom62 Date: Thu, 2 Jul 2026 16:48:48 +1000 Subject: T8989: Add vyos_facts integration and unit tests with fixtures --- docs/vyos.rest.vyos_facts_module.rst | 296 +++++++++++++++++++++++++++++++++++ 1 file changed, 296 insertions(+) create mode 100644 docs/vyos.rest.vyos_facts_module.rst (limited to 'docs') diff --git a/docs/vyos.rest.vyos_facts_module.rst b/docs/vyos.rest.vyos_facts_module.rst new file mode 100644 index 0000000..d5c6a89 --- /dev/null +++ b/docs/vyos.rest.vyos_facts_module.rst @@ -0,0 +1,296 @@ +.. _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 + + + + + + + + + + + + + + + + + +
ParameterChoices/DefaultsComments
+
+ 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FactReturnedDescription
+
+ 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) -- cgit v1.2.3