From 3c6f1fee56c3c6501f19ee1175c7a67d605ddaf8 Mon Sep 17 00:00:00 2001 From: Alina Buzachis Date: Mon, 16 Sep 2024 17:48:23 +0200 Subject: [PATCH] Improve documentation Signed-off-by: Alina Buzachis --- plugins/modules/controller_token.py | 6 ++-- plugins/modules/credential.py | 6 ++-- plugins/modules/credential_info.py | 12 ++++---- plugins/modules/credential_type.py | 32 ++++++++++---------- plugins/modules/credential_type_info.py | 12 ++++---- plugins/modules/decision_environment.py | 6 ++-- plugins/modules/decision_environment_info.py | 6 ++-- plugins/modules/project.py | 13 ++++++-- plugins/modules/project_info.py | 8 ++--- plugins/modules/rulebook_activation.py | 6 ++-- plugins/modules/rulebook_activation_info.py | 12 ++++---- plugins/modules/user.py | 6 ++-- 12 files changed, 67 insertions(+), 58 deletions(-) diff --git a/plugins/modules/controller_token.py b/plugins/modules/controller_token.py index 61cd5bd1..4bb793b3 100644 --- a/plugins/modules/controller_token.py +++ b/plugins/modules/controller_token.py @@ -8,7 +8,7 @@ __metaclass__ = type -DOCUMENTATION = """ +DOCUMENTATION = r""" --- module: controller_token author: @@ -47,7 +47,7 @@ - ansible.eda.eda_controller.auths """ -EXAMPLES = """ +EXAMPLES = r""" - name: Create AWX token ansible.eda.controller_token: controller_host: https://my_eda_host/ @@ -69,7 +69,7 @@ """ -RETURN = """ +RETURN = r""" id: description: ID of the managed AWX token. returned: when state is 'present' and successful diff --git a/plugins/modules/credential.py b/plugins/modules/credential.py index 23c27b44..f69b643d 100644 --- a/plugins/modules/credential.py +++ b/plugins/modules/credential.py @@ -10,7 +10,7 @@ __metaclass__ = type -DOCUMENTATION = """ +DOCUMENTATION = r""" --- module: credential author: @@ -61,7 +61,7 @@ """ -EXAMPLES = """ +EXAMPLES = r""" - name: Create an EDA Credential ansible.eda.credential: name: "Example Credential" @@ -78,7 +78,7 @@ """ -RETURN = """ +RETURN = r""" id: description: ID of the credential. returned: when exists diff --git a/plugins/modules/credential_info.py b/plugins/modules/credential_info.py index 6036f937..a3262824 100644 --- a/plugins/modules/credential_info.py +++ b/plugins/modules/credential_info.py @@ -9,7 +9,7 @@ __metaclass__ = type -DOCUMENTATION = """ +DOCUMENTATION = r""" --- module: credential_info author: @@ -31,17 +31,17 @@ """ -EXAMPLES = """ -- name: Get information about a credential - ansible.eda.credential_info: - name: "Test" +EXAMPLES = r""" + - name: Get information about a credential + ansible.eda.credential_info: + name: "Test" - name: List all credentials ansible.eda.credential_info: """ -RETURN = """ +RETURN = r""" credentials: description: Information about credentials. returned: always diff --git a/plugins/modules/credential_type.py b/plugins/modules/credential_type.py index d79dcc38..d5929335 100644 --- a/plugins/modules/credential_type.py +++ b/plugins/modules/credential_type.py @@ -9,7 +9,7 @@ __metaclass__ = type -DOCUMENTATION = """ +DOCUMENTATION = r""" --- module: credential_type author: @@ -53,20 +53,20 @@ """ -EXAMPLES = """ -- name: Create a credential type - ansible.eda.credential_type: - name: "Test" - state: present - description: "A test credential type" - inputs: - fields: - - id: "Field1" - type: "string" - label: "Label1" - injectors: - extra_vars: - field1: "field1" +EXAMPLES = r""" + - name: Create a credential type + ansible.eda.credential_type: + name: "Test" + state: present + description: "A test credential type" + inputs: + fields: + - id: "Field1" + type: "string" + label: "Label1" + injectors: + extra_vars: + field1: "field1" - name: Delete a credential type ansible.eda.credential_type: @@ -75,7 +75,7 @@ """ -RETURN = """ +RETURN = r""" id: description: ID of the credential type. returned: when exists diff --git a/plugins/modules/credential_type_info.py b/plugins/modules/credential_type_info.py index 047a45e8..066d0aed 100644 --- a/plugins/modules/credential_type_info.py +++ b/plugins/modules/credential_type_info.py @@ -9,7 +9,7 @@ __metaclass__ = type -DOCUMENTATION = """ +DOCUMENTATION = r""" --- module: credential_type_info author: @@ -31,17 +31,17 @@ """ -EXAMPLES = """ -- name: Get information about a credential type - ansible.eda.credential_type_info: - name: "Test" +EXAMPLES = r""" + - name: Get information about a credential type + ansible.eda.credential_type_info: + name: "Test" - name: List all credential types ansible.eda.credential_type_info: """ -RETURN = """ +RETURN = r""" credential_types: description: Information about the credential types. returned: always diff --git a/plugins/modules/decision_environment.py b/plugins/modules/decision_environment.py index e330c3bf..9279d7a6 100644 --- a/plugins/modules/decision_environment.py +++ b/plugins/modules/decision_environment.py @@ -8,7 +8,7 @@ __metaclass__ = type -DOCUMENTATION = """ +DOCUMENTATION = r""" --- module: decision_environment author: @@ -57,7 +57,7 @@ - ansible.eda.eda_controller.auths """ -EXAMPLES = """ +EXAMPLES = r""" - name: Create EDA Decision Environment ansible.eda.decision_environment: controller_host: https://my_eda_host/ @@ -89,7 +89,7 @@ state: absent """ -RETURN = """ +RETURN = r""" id: description: ID of the decision environment returned: when exists diff --git a/plugins/modules/decision_environment_info.py b/plugins/modules/decision_environment_info.py index 5b26bb7c..419d242a 100644 --- a/plugins/modules/decision_environment_info.py +++ b/plugins/modules/decision_environment_info.py @@ -8,7 +8,7 @@ __metaclass__ = type -DOCUMENTATION = """ +DOCUMENTATION = r""" --- module: decision_environment_info author: @@ -26,7 +26,7 @@ - ansible.eda.eda_controller.auths """ -EXAMPLES = """ +EXAMPLES = r""" - name: List all EDA Decision Environments ansible.eda.decision_environment_info: controller_host: https://my_eda_host/ @@ -41,7 +41,7 @@ name: Example """ -RETURN = """ +RETURN = r""" decision_environments: description: List of dict containing information about decision environments returned: when exists diff --git a/plugins/modules/project.py b/plugins/modules/project.py index 4e6ca8a9..5852e992 100644 --- a/plugins/modules/project.py +++ b/plugins/modules/project.py @@ -8,7 +8,7 @@ __metaclass__ = type -DOCUMENTATION = """ +DOCUMENTATION = r""" --- module: project author: @@ -57,7 +57,7 @@ - ansible.eda.eda_controller.auths """ -EXAMPLES = """ +EXAMPLES = r""" - name: Create EDA Projects ansible.eda.project: controller_host: https://my_eda_host/ @@ -90,6 +90,15 @@ state: absent """ +RETURN = r""" +id: + description: ID of the project. + returned: when exists + type: int + sample: 24 +""" + + from typing import Any from ansible.module_utils.basic import AnsibleModule diff --git a/plugins/modules/project_info.py b/plugins/modules/project_info.py index 5455351d..f95768fa 100644 --- a/plugins/modules/project_info.py +++ b/plugins/modules/project_info.py @@ -8,7 +8,7 @@ __metaclass__ = type -DOCUMENTATION = """ +DOCUMENTATION = r""" --- module: project_info author: @@ -27,7 +27,7 @@ - ansible.eda.eda_controller.auths """ -EXAMPLES = """ +EXAMPLES = r""" - name: List a particular project ansible.eda.project_info: controller_host: https://my_eda_host/ @@ -44,9 +44,9 @@ register: r """ -RETURN = """ +RETURN = r""" projects: - description: List of dicts containing information about projects + description: List of dicts containing information about projects. returned: success type: list sample: [ diff --git a/plugins/modules/rulebook_activation.py b/plugins/modules/rulebook_activation.py index 709f8f23..e373ad44 100644 --- a/plugins/modules/rulebook_activation.py +++ b/plugins/modules/rulebook_activation.py @@ -9,7 +9,7 @@ __metaclass__ = type -DOCUMENTATION = """ +DOCUMENTATION = r""" --- module: rulebook_activation author: @@ -143,7 +143,7 @@ not perform any modification when an existing rulebook activation is found. """ -EXAMPLES = """ +EXAMPLES = r""" - name: Create a rulebook activation ansible.eda.rulebook_activation: name: "Example Rulebook Activation" @@ -175,7 +175,7 @@ """ -RETURN = """ +RETURN = r""" id: description: ID of the rulebook activation. returned: when exists diff --git a/plugins/modules/rulebook_activation_info.py b/plugins/modules/rulebook_activation_info.py index 7b5a28c8..7c42048a 100644 --- a/plugins/modules/rulebook_activation_info.py +++ b/plugins/modules/rulebook_activation_info.py @@ -9,7 +9,7 @@ __metaclass__ = type -DOCUMENTATION = """ +DOCUMENTATION = r""" --- module: rulebook_activation_info author: @@ -29,17 +29,17 @@ """ -EXAMPLES = """ -- name: Get information about a rulebook activation - ansible.eda.rulebook_activation_info: - name: "Example Rulebook Activation" +EXAMPLES = r""" + - name: Get information about a rulebook activation + ansible.eda.rulebook_activation_info: + name: "Example Rulebook Activation" - name: List all rulebook activations ansible.eda.rulebook_activation_info: """ -RETURN = """ +RETURN = r""" activations: description: Information about rulebook activations. returned: always diff --git a/plugins/modules/user.py b/plugins/modules/user.py index 6cdc73c4..f1ff120f 100644 --- a/plugins/modules/user.py +++ b/plugins/modules/user.py @@ -8,7 +8,7 @@ __metaclass__ = type -DOCUMENTATION = """ +DOCUMENTATION = r""" --- module: user author: @@ -77,7 +77,7 @@ - ansible.eda.eda_controller.auths """ -EXAMPLES = """ +EXAMPLES = r""" - name: Create EDA user ansible.eda.user: controller_host: https://my_eda_host/ @@ -111,7 +111,7 @@ """ -RETURN = """ +RETURN = r""" id: description: ID of the managed AWX token. returned: when state is 'present' and successful