From 53c62e7a4394c70a8e35d0c25feb4c5040d09867 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Fri, 14 Nov 2025 18:19:50 +0100 Subject: [PATCH] Fix snmp_facts return value docs (#11154) Fix snmp_facts return value docs. --- plugins/modules/snmp_facts.py | 151 ++++++++++++++++++---------------- 1 file changed, 78 insertions(+), 73 deletions(-) diff --git a/plugins/modules/snmp_facts.py b/plugins/modules/snmp_facts.py index 7ea53c85be..bb301105c6 100644 --- a/plugins/modules/snmp_facts.py +++ b/plugins/modules/snmp_facts.py @@ -13,7 +13,7 @@ author: - Patrick Ogenstad (@ogenstad) short_description: Retrieve facts for a device using SNMP description: - - Retrieve facts for a device using SNMP, the facts are inserted to the RV(ignore:ansible_facts) key. + - Retrieve facts for a device using SNMP. The facts are inserted to the RV(ansible_facts) key. requirements: - pysnmp extends_documentation_fragment: @@ -107,81 +107,86 @@ EXAMPLES = r""" """ RETURN = r""" -ansible_sysdescr: - description: A textual description of the entity. - returned: success - type: str - sample: "Linux ubuntu-user 4.4.0-93-generic #116-Ubuntu SMP Fri Aug 11 21:17:51 UTC 2017 x86_64" -ansible_sysobjectid: - description: The vendor's authoritative identification of the network management subsystem contained in the entity. - returned: success - type: str - sample: 1.3.6.1.4.1.8072.3.2.10 -ansible_sysuptime: - description: The time (in hundredths of a second) since the network management portion of the system was last re-initialized. - returned: success - type: int - sample: 42388 -ansible_syscontact: - description: The textual identification of the contact person for this managed node, together with information on how to - contact this person. - returned: success - type: str - sample: Me -ansible_sysname: - description: An administratively-assigned name for this managed node. - returned: success - type: str - sample: ubuntu-user -ansible_syslocation: - description: The physical location of this node (for example, V(telephone closet, 3rd floor)). - returned: success - type: str - sample: Sitting on the Dock of the Bay -ansible_all_ipv4_addresses: - description: List of all IPv4 addresses. - returned: success - type: list - sample: ["127.0.0.1", "172.17.0.1"] -ansible_interfaces: - description: Dictionary of each network interface and its metadata. +ansible_facts: + description: The returned facts. returned: success type: dict - sample: - { - "1": { - "adminstatus": "up", - "description": "", - "ifindex": "1", - "ipv4": [ - { - "address": "127.0.0.1", - "netmask": "255.0.0.0" + contains: + ansible_sysdescr: + description: A textual description of the entity. + returned: success + type: str + sample: "Linux ubuntu-user 4.4.0-93-generic #116-Ubuntu SMP Fri Aug 11 21:17:51 UTC 2017 x86_64" + ansible_sysobjectid: + description: The vendor's authoritative identification of the network management subsystem contained in the entity. + returned: success + type: str + sample: 1.3.6.1.4.1.8072.3.2.10 + ansible_sysuptime: + description: The time (in hundredths of a second) since the network management portion of the system was last re-initialized. + returned: success + type: int + sample: 42388 + ansible_syscontact: + description: The textual identification of the contact person for this managed node, together with information on how to + contact this person. + returned: success + type: str + sample: Me + ansible_sysname: + description: An administratively-assigned name for this managed node. + returned: success + type: str + sample: ubuntu-user + ansible_syslocation: + description: The physical location of this node (for example, V(telephone closet, 3rd floor)). + returned: success + type: str + sample: Sitting on the Dock of the Bay + ansible_all_ipv4_addresses: + description: List of all IPv4 addresses. + returned: success + type: list + sample: ["127.0.0.1", "172.17.0.1"] + ansible_interfaces: + description: Dictionary of each network interface and its metadata. + returned: success + type: dict + sample: + { + "1": { + "adminstatus": "up", + "description": "", + "ifindex": "1", + "ipv4": [ + { + "address": "127.0.0.1", + "netmask": "255.0.0.0" + } + ], + "mac": "", + "mtu": "65536", + "name": "lo", + "operstatus": "up", + "speed": "65536" + }, + "2": { + "adminstatus": "up", + "description": "", + "ifindex": "2", + "ipv4": [ + { + "address": "192.168.213.128", + "netmask": "255.255.255.0" + } + ], + "mac": "000a305a52a1", + "mtu": "1500", + "name": "Intel Corporation 82545EM Gigabit Ethernet Controller (Copper)", + "operstatus": "up", + "speed": "1500" } - ], - "mac": "", - "mtu": "65536", - "name": "lo", - "operstatus": "up", - "speed": "65536" - }, - "2": { - "adminstatus": "up", - "description": "", - "ifindex": "2", - "ipv4": [ - { - "address": "192.168.213.128", - "netmask": "255.255.255.0" - } - ], - "mac": "000a305a52a1", - "mtu": "1500", - "name": "Intel Corporation 82545EM Gigabit Ethernet Controller (Copper)", - "operstatus": "up", - "speed": "1500" - } - } + } """ import binascii