From 16fa40954ceeca9282ec21d96d0618b2bb357609 Mon Sep 17 00:00:00 2001 From: Alina Buzachis Date: Thu, 12 Sep 2024 11:28:45 +0200 Subject: [PATCH 1/2] Ensure the mandatory fields required by the EDA API are respcted within the modules Signed-off-by: Alina Buzachis --- plugins/modules/controller_token.py | 6 +++--- plugins/modules/credential.py | 6 +++--- plugins/modules/credential_info.py | 6 +++--- plugins/modules/credential_type.py | 6 +++--- plugins/modules/credential_type_info.py | 6 +++--- plugins/modules/decision_environment.py | 6 +++--- plugins/modules/decision_environment_info.py | 6 +++--- plugins/modules/project.py | 4 ++-- plugins/modules/project_info.py | 6 +++--- plugins/modules/rulebook_activation.py | 8 ++++---- plugins/modules/rulebook_activation_info.py | 6 +++--- plugins/modules/user.py | 6 +++--- 12 files changed, 36 insertions(+), 36 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 3e1bebc7..64f1e688 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,7 +31,7 @@ """ -EXAMPLES = """ +EXAMPLES = r""" - name: Get information about a credential ansible.eda.credential_info: name: "Test" @@ -41,7 +41,7 @@ """ -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 ed085667..9b672391 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,7 +53,7 @@ """ -EXAMPLES = """ +EXAMPLES = r""" - name: Create a credential type ansible.eda.credential_type: name: "Test" @@ -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 e0f3e3dd..ecdb89f8 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,7 +31,7 @@ """ -EXAMPLES = """ +EXAMPLES = r""" - name: Get information about a credential type ansible.eda.credential_type_info: name: "Test" @@ -41,7 +41,7 @@ """ -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..71fe64f3 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/ diff --git a/plugins/modules/project_info.py b/plugins/modules/project_info.py index 5455351d..e5ff86f9 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,7 +44,7 @@ register: r """ -RETURN = """ +RETURN = r""" projects: description: List of dicts containing information about projects returned: success diff --git a/plugins/modules/rulebook_activation.py b/plugins/modules/rulebook_activation.py index 27d73abf..a2feb342 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 @@ -459,7 +459,7 @@ def main() -> None: ( "state", "present", - ("name", "rulebook_name", "decision_environment_name"), + ("name", "rulebook_name", "decision_environment_name", "project_name"), ) ] diff --git a/plugins/modules/rulebook_activation_info.py b/plugins/modules/rulebook_activation_info.py index 2572327d..153f7cdc 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,7 +29,7 @@ """ -EXAMPLES = """ +EXAMPLES = r""" - name: Get information about a rulebook activation ansible.eda.rulebook_activation_info: name: "Example Rulebook Activation" @@ -39,7 +39,7 @@ """ -RETURN = """ +RETURN = r""" activations: description: Information about rulebook activations. returned: always diff --git a/plugins/modules/user.py b/plugins/modules/user.py index c1d02878..48f51e27 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 From 778a04306df7deebe29becb89d6902a6376d8be1 Mon Sep 17 00:00:00 2001 From: Alina Buzachis Date: Mon, 16 Sep 2024 15:15:13 +0200 Subject: [PATCH 2/2] Undo raw string chhanges Signed-off-by: Alina Buzachis --- plugins/modules/controller_token.py | 6 +++--- plugins/modules/credential.py | 6 +++--- plugins/modules/credential_info.py | 6 +++--- plugins/modules/credential_type.py | 6 +++--- plugins/modules/credential_type_info.py | 6 +++--- plugins/modules/decision_environment.py | 6 +++--- plugins/modules/decision_environment_info.py | 6 +++--- plugins/modules/project.py | 4 ++-- plugins/modules/project_info.py | 6 +++--- plugins/modules/rulebook_activation.py | 6 +++--- plugins/modules/rulebook_activation_info.py | 6 +++--- plugins/modules/user.py | 6 +++--- 12 files changed, 35 insertions(+), 35 deletions(-) diff --git a/plugins/modules/controller_token.py b/plugins/modules/controller_token.py index 4bb793b3..61cd5bd1 100644 --- a/plugins/modules/controller_token.py +++ b/plugins/modules/controller_token.py @@ -8,7 +8,7 @@ __metaclass__ = type -DOCUMENTATION = r""" +DOCUMENTATION = """ --- module: controller_token author: @@ -47,7 +47,7 @@ - ansible.eda.eda_controller.auths """ -EXAMPLES = r""" +EXAMPLES = """ - name: Create AWX token ansible.eda.controller_token: controller_host: https://my_eda_host/ @@ -69,7 +69,7 @@ """ -RETURN = r""" +RETURN = """ 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 f69b643d..23c27b44 100644 --- a/plugins/modules/credential.py +++ b/plugins/modules/credential.py @@ -10,7 +10,7 @@ __metaclass__ = type -DOCUMENTATION = r""" +DOCUMENTATION = """ --- module: credential author: @@ -61,7 +61,7 @@ """ -EXAMPLES = r""" +EXAMPLES = """ - name: Create an EDA Credential ansible.eda.credential: name: "Example Credential" @@ -78,7 +78,7 @@ """ -RETURN = r""" +RETURN = """ id: description: ID of the credential. returned: when exists diff --git a/plugins/modules/credential_info.py b/plugins/modules/credential_info.py index 64f1e688..3e1bebc7 100644 --- a/plugins/modules/credential_info.py +++ b/plugins/modules/credential_info.py @@ -9,7 +9,7 @@ __metaclass__ = type -DOCUMENTATION = r""" +DOCUMENTATION = """ --- module: credential_info author: @@ -31,7 +31,7 @@ """ -EXAMPLES = r""" +EXAMPLES = """ - name: Get information about a credential ansible.eda.credential_info: name: "Test" @@ -41,7 +41,7 @@ """ -RETURN = r""" +RETURN = """ credentials: description: Information about credentials. returned: always diff --git a/plugins/modules/credential_type.py b/plugins/modules/credential_type.py index 9b672391..ed085667 100644 --- a/plugins/modules/credential_type.py +++ b/plugins/modules/credential_type.py @@ -9,7 +9,7 @@ __metaclass__ = type -DOCUMENTATION = r""" +DOCUMENTATION = """ --- module: credential_type author: @@ -53,7 +53,7 @@ """ -EXAMPLES = r""" +EXAMPLES = """ - name: Create a credential type ansible.eda.credential_type: name: "Test" @@ -75,7 +75,7 @@ """ -RETURN = r""" +RETURN = """ 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 ecdb89f8..e0f3e3dd 100644 --- a/plugins/modules/credential_type_info.py +++ b/plugins/modules/credential_type_info.py @@ -9,7 +9,7 @@ __metaclass__ = type -DOCUMENTATION = r""" +DOCUMENTATION = """ --- module: credential_type_info author: @@ -31,7 +31,7 @@ """ -EXAMPLES = r""" +EXAMPLES = """ - name: Get information about a credential type ansible.eda.credential_type_info: name: "Test" @@ -41,7 +41,7 @@ """ -RETURN = r""" +RETURN = """ 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 9279d7a6..e330c3bf 100644 --- a/plugins/modules/decision_environment.py +++ b/plugins/modules/decision_environment.py @@ -8,7 +8,7 @@ __metaclass__ = type -DOCUMENTATION = r""" +DOCUMENTATION = """ --- module: decision_environment author: @@ -57,7 +57,7 @@ - ansible.eda.eda_controller.auths """ -EXAMPLES = r""" +EXAMPLES = """ - name: Create EDA Decision Environment ansible.eda.decision_environment: controller_host: https://my_eda_host/ @@ -89,7 +89,7 @@ state: absent """ -RETURN = r""" +RETURN = """ 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 419d242a..5b26bb7c 100644 --- a/plugins/modules/decision_environment_info.py +++ b/plugins/modules/decision_environment_info.py @@ -8,7 +8,7 @@ __metaclass__ = type -DOCUMENTATION = r""" +DOCUMENTATION = """ --- module: decision_environment_info author: @@ -26,7 +26,7 @@ - ansible.eda.eda_controller.auths """ -EXAMPLES = r""" +EXAMPLES = """ - name: List all EDA Decision Environments ansible.eda.decision_environment_info: controller_host: https://my_eda_host/ @@ -41,7 +41,7 @@ name: Example """ -RETURN = r""" +RETURN = """ 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 71fe64f3..4e6ca8a9 100644 --- a/plugins/modules/project.py +++ b/plugins/modules/project.py @@ -8,7 +8,7 @@ __metaclass__ = type -DOCUMENTATION = r""" +DOCUMENTATION = """ --- module: project author: @@ -57,7 +57,7 @@ - ansible.eda.eda_controller.auths """ -EXAMPLES = r""" +EXAMPLES = """ - name: Create EDA Projects ansible.eda.project: controller_host: https://my_eda_host/ diff --git a/plugins/modules/project_info.py b/plugins/modules/project_info.py index e5ff86f9..5455351d 100644 --- a/plugins/modules/project_info.py +++ b/plugins/modules/project_info.py @@ -8,7 +8,7 @@ __metaclass__ = type -DOCUMENTATION = r""" +DOCUMENTATION = """ --- module: project_info author: @@ -27,7 +27,7 @@ - ansible.eda.eda_controller.auths """ -EXAMPLES = r""" +EXAMPLES = """ - name: List a particular project ansible.eda.project_info: controller_host: https://my_eda_host/ @@ -44,7 +44,7 @@ register: r """ -RETURN = r""" +RETURN = """ projects: description: List of dicts containing information about projects returned: success diff --git a/plugins/modules/rulebook_activation.py b/plugins/modules/rulebook_activation.py index a2feb342..255f0cf8 100644 --- a/plugins/modules/rulebook_activation.py +++ b/plugins/modules/rulebook_activation.py @@ -9,7 +9,7 @@ __metaclass__ = type -DOCUMENTATION = r""" +DOCUMENTATION = """ --- module: rulebook_activation author: @@ -143,7 +143,7 @@ not perform any modification when an existing rulebook activation is found. """ -EXAMPLES = r""" +EXAMPLES = """ - name: Create a rulebook activation ansible.eda.rulebook_activation: name: "Example Rulebook Activation" @@ -175,7 +175,7 @@ """ -RETURN = r""" +RETURN = """ 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 153f7cdc..2572327d 100644 --- a/plugins/modules/rulebook_activation_info.py +++ b/plugins/modules/rulebook_activation_info.py @@ -9,7 +9,7 @@ __metaclass__ = type -DOCUMENTATION = r""" +DOCUMENTATION = """ --- module: rulebook_activation_info author: @@ -29,7 +29,7 @@ """ -EXAMPLES = r""" +EXAMPLES = """ - name: Get information about a rulebook activation ansible.eda.rulebook_activation_info: name: "Example Rulebook Activation" @@ -39,7 +39,7 @@ """ -RETURN = r""" +RETURN = """ activations: description: Information about rulebook activations. returned: always diff --git a/plugins/modules/user.py b/plugins/modules/user.py index 48f51e27..c1d02878 100644 --- a/plugins/modules/user.py +++ b/plugins/modules/user.py @@ -8,7 +8,7 @@ __metaclass__ = type -DOCUMENTATION = r""" +DOCUMENTATION = """ --- module: user author: @@ -77,7 +77,7 @@ - ansible.eda.eda_controller.auths """ -EXAMPLES = r""" +EXAMPLES = """ - name: Create EDA user ansible.eda.user: controller_host: https://my_eda_host/ @@ -111,7 +111,7 @@ """ -RETURN = r""" +RETURN = """ id: description: ID of the managed AWX token. returned: when state is 'present' and successful