Skip to content

Documentation fix #10

Description

@mowgli

I fixed the documentation to be at least usable via ansible-doc:

From d1694d3350b0e8970280616ec1f4d1c386facefd Mon Sep 17 00:00:00 2001
From: Klaus Ethgen <klaus.ethgen@wsl.ch>
Date: Tue, 15 Apr 2025 14:24:21 +0200
Subject: [PATCH] Fix documentation

---
 modules/network/ne/ne_config.py | 48 +++++++++++++++----------------
 modules/network/ne/ne_facts.py  | 51 ++++++++++++++++-----------------
 2 files changed, 48 insertions(+), 51 deletions(-)

diff --git a/modules/network/ne/ne_config.py b/modules/network/ne/ne_config.py
index 1e91c26..433d671 100644
--- a/modules/network/ne/ne_config.py
+++ b/modules/network/ne/ne_config.py
@@ -27,7 +27,7 @@ DOCUMENTATION = """
 ---
 
 module: ne_config
-version_added: "2.4
+version_added: "2.4"
 author: "LiQingKai (@NetEngine-Ansible)"
 short_description: Search or Manage Huawei Router configuration sections. 
 description:
@@ -39,62 +39,62 @@ options:
   section:
     description:
       - This argument will send a command to get particular branch of the running configuration from the remote device
-      the value should be a list of configuration  branch names like 'aaa' , 'bgp'...
+        the value should be a list of configuration  branch names like 'aaa' , 'bgp'...
     required: false
     default: null
   contain:
     description:
       - This argument will search configuration lines containing defined text
-      the value should be a list of defined text
+        the value should be a list of defined text
     required: false
     default: null
   backup:
     description:
         - This argument will cause the module to create a full backup of
-        the current C(current-configuration) from the remote device before any
-        changes are made.  The backup file is written to the C(backup)
-        folder in the playbook root directory.  If the directory does not
-        exist, it will be created.
-        the value should be the cfg file name to save like 'snmp.cfg'
+          the current C(current-configuration) from the remote device before any
+          changes are made.  The backup file is written to the C(backup)
+          folder in the playbook root directory.  If the directory does not
+          exist, it will be created.
+          the value should be the cfg file name to save like 'snmp.cfg'
     required: false
     default: null
   backup_all:
     description:
         - This argument will cause the module to download all backups in remote device 
-        to the local path of "local_file_path"
-        If the directory does not exist, it will be created.
+          to the local path of "local_file_path"
+          If the directory does not exist, it will be created.
     required: false
     default: false
   transfer:
     description:
         - This argument will send a config configurations file to the remote device. 
-        the value should be the local cfg file path like '/opt/snmp.cfg'
-        Local flie must be exist
+          the value should be the local cfg file path like '/opt/snmp.cfg'
+          Local flie must be exist
     required: false
     default: null
   delete:
     description:
       - This argument will send a command to delete particular configuration files from the remote device
-      the value should be a list of cfg file names like 'snmp.cfg'
+        the value should be a list of cfg file names like 'snmp.cfg'
     required: false
     default: null
   replace:
     description:
-      -  This argument will replace the current configuration to specified one with the cfg name of "replace" value
-      the value should be a list of cfg file names like 'snmp.cfg'
+      - This argument will replace the current configuration to specified one with the cfg name of "replace" value
+        the value should be a list of cfg file names like 'snmp.cfg'
     required: false
     default: null
   merge:
     description:
-      -  This argument will  merge configuration files to the current configuration with the cfg name of "merge" value
-      the value should be a cfg file name like 'snmp.cfg'
+      - This argument will  merge configuration files to the current configuration with the cfg name of "merge" value
+        the value should be a cfg file name like 'snmp.cfg'
     required: false
     default: null
   rollback:
     description:
-      -  This argument will rollback the current configuration to specified one with the specified mode
-      the value should be a cfg file name like 'snmp.cfg' or commit-id like '1000000010'
-      or label name like "new_label" or last rollback number like '2'
+      - This argument will rollback the current configuration to specified one with the specified mode
+        the value should be a cfg file name like 'snmp.cfg' or commit-id like '1000000010'
+        or label name like "new_label" or last rollback number like '2'
     required: false
     default: null 
   rollback_type:
@@ -106,13 +106,13 @@ options:
   local_file:
     description:
         - Local file path for backup file to save . Local directory must be exist.
-        When there is 'transfer' not null in playbook,the 'local_file' should be required.
+          When there is 'transfer' not null in playbook,the 'local_file' should be required.
     required: false
     default: null
   local_file_path:
     description:
         - Local path for backup file to save . Local directory must exist.
-        When there is 'backup' or 'backup_all' in playbook,the 'local_file_path' should be required.
+          When there is 'backup' or 'backup_all' in playbook,the 'local_file_path' should be required.
     required: false
     default: null
   commit:
@@ -128,8 +128,8 @@ options:
     default: false
   trial:
     description:
-      -  This argument will allow to delay confirmation of the commitment with a specified time
-      the value should be a value of second between 60 and 3600
+      - This argument will allow to delay confirmation of the commitment with a specified time
+        the value should be a value of second between 60 and 3600
     required: false
     default: null
 
diff --git a/modules/network/ne/ne_facts.py b/modules/network/ne/ne_facts.py
index 680f0f6..5869790 100644
--- a/modules/network/ne/ne_facts.py
+++ b/modules/network/ne/ne_facts.py
@@ -148,13 +148,13 @@ System Info:
       returned: always
       type: str
 Licence Info:
-    description: Proof of permission granted.
+  description: Proof of permission granted.
+  returned: always
+  type: dict
+  LicenceItem:
+    description: All license items.
     returned: always
     type: dict
-  LicenceItem:
-      description: All license items.
-      returned: always
-      type: dict
     name:
         description: License item name.
         returned: always
@@ -167,11 +167,10 @@ Licence Info:
         description: The default value of a license item.
         returned: always
         type: str
-    ...
   LicenceFileInfo:
-      description: All information of a license file.
-      returned: always
-      type: dict
+    description: All information of a license file.
+    returned: always
+    type: dict
     filename:
         description: The name of a license file.
         returned: always
@@ -184,19 +183,18 @@ Licence Info:
         description: The general information of a license file.
         returned: always
         type: dict
-      serial-number:
-          description: The serial number of a license file.
-          returned: always
-          type: str
-      creator:
-          description: The creator of a license file.
-          returned: always
-          type: str
-      created-time:
-          description: The created time of a license file.
-          returned: always
-          type: str
-      ...
+    serial-number:
+        description: The serial number of a license file.
+        returned: always
+        type: str
+    creator:
+        description: The creator of a license file.
+        returned: always
+        type: str
+    created-time:
+        description: The created time of a license file.
+        returned: always
+        type: str
 #hardware
 CPU:
   description: CPU information of boards.
@@ -277,13 +275,12 @@ phyEntity:
     index:
         description: Entity index.
         returned: when hardware is configured
-        type: str:
+        type: str
     chassis-index:
         description: Chassis index.
         returned: when hardware is configured
-        type: str:
-     ...
- #Interfaces
+        type: str
+#Interfaces
 Ipv4 Addr:
   description: All IPv4 addresses configured on the device
   returned: when interfaces is configured
@@ -321,7 +318,7 @@ Ipv6 Addr:
       returned: when interfaces is configured
       type: str
 #lldpneighbors
-lldoNeighbors Info
+lldoNeighbors Info:
     description: The list of LLDP neighbors from the remote device.
     returned: when lldoneighbors is configured
     type: str
-- 
2.39.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions