From e7fd3c05ac01a2af1a4209d327b1d319fed58023 Mon Sep 17 00:00:00 2001 From: Alina Buzachis Date: Tue, 20 Aug 2024 13:08:41 +0200 Subject: [PATCH] Use module_defaults Signed-off-by: Alina Buzachis --- .github/workflows/integration.yml | 2 +- plugins/module_utils/controller.py | 2 +- plugins/modules/activation.py | 4 +- plugins/modules/project_info.py | 9 +- .../targets/activation/tasks/main.yml | 51 +-- .../targets/controller_token/tasks/create.yml | 12 - .../targets/controller_token/tasks/main.yml | 14 +- .../targets/credential/tasks/main.yml | 354 +++++++++--------- .../targets/credential_type/tasks/main.yml | 345 +++++++++-------- .../decision_environment/tasks/create.yml | 20 - .../decision_environment/tasks/delete.yml | 12 - .../decision_environment/tasks/main.yml | 13 +- .../decision_environment/tasks/update.yml | 16 - .../decision_environment_info/tasks/list.yml | 20 - .../decision_environment_info/tasks/main.yml | 14 +- .../targets/project/tasks/create.yml | 20 - .../targets/project/tasks/delete.yml | 4 - .../targets/project/tasks/main.yml | 14 +- .../targets/project/tasks/update.yml | 16 - .../targets/project_info/tasks/create.yml | 4 - .../targets/project_info/tasks/main.yml | 30 +- .../integration/targets/user/tasks/create.yml | 32 -- tests/integration/targets/user/tasks/main.yml | 13 +- .../integration/targets/user/tasks/update.yml | 12 - 24 files changed, 409 insertions(+), 624 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index d79fc0be..d392c2c2 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -73,5 +73,5 @@ jobs: working-directory: ansible_collections/ansible/eda - name: Run integration tests - run: ansible-test integration project + run: ansible-test integration -v working-directory: ansible_collections/ansible/eda diff --git a/plugins/module_utils/controller.py b/plugins/module_utils/controller.py index c01211c6..a96a3b8a 100644 --- a/plugins/module_utils/controller.py +++ b/plugins/module_utils/controller.py @@ -91,7 +91,7 @@ def get_exactly_one( self, endpoint, name=None, **kwargs ) -> Optional[dict[str, bool]]: result = self.get_one_or_many( - endpoint, name=name, allow_none=False, want_one=True, **kwargs + endpoint, name=name, allow_none=True, want_one=True, **kwargs ) # typing: needed as get_one_or_many can also return lists, not expected # to reach this ever. diff --git a/plugins/modules/activation.py b/plugins/modules/activation.py index cdb48156..6cfe0c05 100644 --- a/plugins/modules/activation.py +++ b/plugins/modules/activation.py @@ -165,7 +165,7 @@ def lookup(module: AnsibleModule, controller: Controller, endpoint, name): def create_params(module: AnsibleModule, controller: Controller) -> dict[str, Any]: - activation_params = {} + activation_params: dict[str, Any] = {} # Get the project id project_id = None @@ -303,7 +303,7 @@ def main() -> None: argument_spec.update(AUTH_ARGSPEC) required_if = [ - ("state", "present", ("name", "rulebook_name", "decision_environment_name")) + ("state", "present", ("name", "rulebook_name", "decision_environment_name", "organization_name")) ] module = AnsibleModule( diff --git a/plugins/modules/project_info.py b/plugins/modules/project_info.py index 94034e09..983d9d05 100644 --- a/plugins/modules/project_info.py +++ b/plugins/modules/project_info.py @@ -80,6 +80,7 @@ # pylint: disable=relative-beyond-top-level from ..module_utils.arguments import AUTH_ARGSPEC from ..module_utils.client import Client +from ..module_utils.common import to_list_of_dict from ..module_utils.controller import Controller from ..module_utils.errors import EDAError @@ -106,8 +107,6 @@ def main() -> None: project_name = module.params.get("name") - ret: list[Any] = [] - try: result = controller.get_one_or_many( project_endpoint, name=project_name, want_one=False @@ -115,11 +114,7 @@ def main() -> None: except EDAError as eda_err: module.fail_json(msg=str(eda_err)) - if result is None: - ret = [] - if not isinstance(result, list): - ret = [result] - module.exit_json(projects=ret) + module.exit_json(projects=to_list_of_dict(result)) if __name__ == "__main__": diff --git a/tests/integration/targets/activation/tasks/main.yml b/tests/integration/targets/activation/tasks/main.yml index adf74914..2bd6d091 100644 --- a/tests/integration/targets/activation/tasks/main.yml +++ b/tests/integration/targets/activation/tasks/main.yml @@ -1,14 +1,12 @@ --- -- block: - - name: Set defaults for credentials - set_fact: - credential_defaults: &credential_defaults - controller_username: "{{ controller_username }}" - controller_password: "{{ controller_password }}" - controller_host: "{{ controller_host }}" - validate_certs: false - no_log: true - +- name: Rulebook activation integration tests + module_defaults: + group/ansible.eda.eda: + controller_host: "{{ controller_host }}" + controller_username: "{{ controller_username }}" + controller_password: "{{ controller_password }}" + validate_certs: "{{ controller_verify_ssl }}" + block: - name: Generate a random_string for the test set_fact: random_string: "{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}" @@ -34,7 +32,6 @@ - name: Create an AWX controller token ansible.eda.controller_token: - <<: *credential_defaults name: "{{ awx_token_name }}" description: "A test AWX controller token description" token: "{{ token_value }}" @@ -42,7 +39,6 @@ - name: Create a new credential type ansible.eda.credential_type: - <<: *credential_defaults name: "{{ credential_type_name }}" state: present description: "A test credential type" @@ -87,10 +83,10 @@ - name: Read the generated key set_fact: ssh_key_data: "{{ lookup('file', tempdir.stdout + '/id_rsa') }}" + no_log: true - name: Create a new SCM credential ansible.eda.credential: - <<: *credential_defaults name: "{{ credential_name }}" state: present credential_type_name: Source Control @@ -110,7 +106,6 @@ - name: Create a new project ansible.eda.project: - <<: *credential_defaults name: "{{ project_name }}" description: "Test Project Description" url: "{{ scm_url }}" @@ -127,7 +122,6 @@ - name: Create a new decision environment ansible.eda.decision_environment: - <<: *credential_defaults name: "{{ decision_env_name }}" description: "Test Decision Environment Description" credential: "{{ credential_name }}" @@ -137,7 +131,6 @@ - name: Create a new rulebook activation in check mode ansible.eda.activation: - <<: *credential_defaults name: "{{ activation_name }}" description: "Example Activation description" project_name: "{{ project_name }}" @@ -156,7 +149,6 @@ - name: Create a new rulebook activation ansible.eda.activation: - <<: *credential_defaults name: "{{ activation_name }}" description: "Example Activation description" project_name: "{{ project_name }}" @@ -174,7 +166,6 @@ - name: Create a new rulebook activation again ansible.eda.activation: - <<: *credential_defaults name: "{{ activation_name }}" description: "Example Activation description" project_name: "{{ project_name }}" @@ -193,16 +184,13 @@ - name: Get information about the rulebook activation ansible.eda.activation_info: - <<: *credential_defaults name: "{{ activation_name }}" - name: List all the rulebook activations ansible.eda.activation_info: - <<: *credential_defaults - name: Delete project ansible.eda.project: - <<: *credential_defaults name: "{{ project_name }}" state: absent register: project_deletion @@ -215,7 +203,6 @@ - name: Delete credential ansible.eda.credential: - <<: *credential_defaults name: "{{ credential_name }}" state: absent register: credential_deletion @@ -228,49 +215,43 @@ - name: Delete rulebook activation ansible.eda.activation: - <<: *credential_defaults name: "{{ activation_name }}" state: absent always: - name: Delete AWX token ansible.eda.controller_token: - <<: *credential_defaults name: "{{ awx_token_name }}" state: absent ignore_errors: true - name: Delete project ansible.eda.project: - <<: *credential_defaults name: "{{ project_name }}" state: absent ignore_errors: true - - name: Delete decision environment - ansible.eda.decision_environment: - <<: *credential_defaults - name: "{{ decision_env_name }}" - state: absent - ignore_errors: true - - name: Delete credential ansible.eda.credential: - <<: *credential_defaults name: "{{ credential_name }}" state: absent ignore_errors: true - name: Delete credential type ansible.eda.credential_type: - <<: *credential_defaults name: "{{ credential_type_name }}" state: absent ignore_errors: true - name: Delete rulebook activation ansible.eda.activation: - <<: *credential_defaults name: "{{ activation_name }}" state: absent ignore_errors: true + + - name: Delete decision environment + ansible.eda.decision_environment: + name: "{{ decision_env_name }}" + state: absent + ignore_errors: true + diff --git a/tests/integration/targets/controller_token/tasks/create.yml b/tests/integration/targets/controller_token/tasks/create.yml index 0e22d5d7..edcaabe4 100644 --- a/tests/integration/targets/controller_token/tasks/create.yml +++ b/tests/integration/targets/controller_token/tasks/create.yml @@ -4,10 +4,6 @@ - name: Create controller token in check mode ansible.eda.controller_token: - controller_host: "{{ controller_host }}" - controller_username: "{{ controller_username }}" - controller_password: "{{ controller_password }}" - validate_certs: "{{ controller_verify_ssl }}" name: "{{ controller_token_name }}" description: "Example controller token description" token: "TOKEN_VALUE" @@ -23,10 +19,6 @@ - name: Create controller token ansible.eda.controller_token: - controller_host: "{{ controller_host }}" - controller_username: "{{ controller_username }}" - controller_password: "{{ controller_password }}" - validate_certs: "{{ controller_verify_ssl }}" name: "{{ controller_token_name }}" description: "Example controller token description" token: "TOKEN_VALUE" @@ -42,10 +34,6 @@ - name: Create controller token again ansible.eda.controller_token: - controller_host: "{{ controller_host }}" - controller_username: "{{ controller_username }}" - controller_password: "{{ controller_password }}" - validate_certs: "{{ controller_verify_ssl }}" name: "{{ controller_token_name }}" description: "Example controller token description" token: "TOKEN_VALUE" diff --git a/tests/integration/targets/controller_token/tasks/main.yml b/tests/integration/targets/controller_token/tasks/main.yml index 3b0a3c76..8ce95371 100644 --- a/tests/integration/targets/controller_token/tasks/main.yml +++ b/tests/integration/targets/controller_token/tasks/main.yml @@ -2,7 +2,15 @@ # Copyright: Contributors to the Ansible project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -- block: +- name: Controller token integration tests + module_defaults: + group/ansible.eda.eda: + controller_host: "{{ controller_host }}" + controller_username: "{{ controller_username }}" + controller_password: "{{ controller_password }}" + validate_certs: "{{ controller_verify_ssl }}" + + block: - name: Generate a random_string for the test set_fact: random_string: "{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}" @@ -21,10 +29,6 @@ always: - name: Clean up - controller token ansible.eda.controller_token: - controller_host: "{{ controller_host }}" - controller_username: "{{ controller_username }}" - controller_password: "{{ controller_password }}" - validate_certs: "{{ controller_verify_ssl }}" name: "{{ item }}" state: absent loop: diff --git a/tests/integration/targets/credential/tasks/main.yml b/tests/integration/targets/credential/tasks/main.yml index 9af282a1..d537a994 100644 --- a/tests/integration/targets/credential/tasks/main.yml +++ b/tests/integration/targets/credential/tasks/main.yml @@ -1,193 +1,178 @@ --- -- block: - - set_fact: - credential_defaults: &credential_defaults - controller_username: "{{ controller_username }}" - controller_password: "{{ controller_password }}" - controller_host: "{{ controller_host }}" - validate_certs: false - no_log: true - - - name: Generate a random_string for the test - set_fact: - random_string: "{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}" - when: random_string is not defined - - - name: Generate a ID for the test - set_fact: - test_id: "{{ random_string | to_uuid }}" - when: test_id is not defined - - - name: Define variables for credential and project - set_fact: - credential_name: "Test_Credential_{{ test_id }}" - new_credential_name: "New_Test_Credential_{{ test_id }}" - credential_type_name: "Test_CredentialType_{{ test_id }}" - - # CREATE - - name: Create credential type - ansible.eda.credential_type: - <<: *credential_defaults - name: "{{ credential_type_name }}" - state: present - description: "A test credential type" - inputs: - fields: - - id: "field1" - type: "string" - label: "Field 5" - injectors: - extra_vars: - field1: "field1" - - - name: Create credential in check mode - ansible.eda.credential: - <<: *credential_defaults - state: present - name: "{{ credential_name }}" - description: "This is a test credential" - credential_type_name: "{{ credential_type_name }}" - inputs: - field1: "field1" - organization_name: Default - check_mode: true - register: _result - - - name: Check credential creation in check mode - assert: - that: - - _result.changed - - - name: Create credential - ansible.eda.credential: - <<: *credential_defaults - state: present - name: "{{ credential_name }}" - description: "This is a test credential" - credential_type_name: "{{ credential_type_name }}" - inputs: - field1: "field1" - organization_name: Default - register: _result - - - name: Check credential creation - assert: - that: - - _result.changed - - - name: Create credential again - ansible.eda.credential: - <<: *credential_defaults - state: present - name: "{{ credential_name }}" - description: "This is a test credential" - credential_type_name: "{{ credential_type_name }}" - inputs: - field1: "field1" - organization_name: Default - register: _result - - # [WARNING]: The field inputs of unknown 3 has encrypted data and may inaccurately report task is changed. - - name: Check credential is not created again - assert: - that: - - not _result.changed - ignore_errors: true - - - name: Get info about a credential - ansible.eda.credential_info: - <<: *credential_defaults - name: "{{ credential_name }}" - - # UPDATE - - name: Update credential name - ansible.eda.credential: - <<: *credential_defaults - state: present - name: "{{ new_credential_name }}" - description: "This is a test credential" - credential_type_name: "{{ credential_type_name }}" - inputs: - field1: "field1" - organization_name: Default - register: _result - - - name: Check credential update - assert: - that: - - _result.changed - - - name: Update credential again - ansible.eda.credential: - <<: *credential_defaults - state: present - name: "{{ new_credential_name }}" - description: "This is a test credential" - credential_type_name: "{{ credential_type_name }}" - inputs: +- name: Credential integration tests + module_defaults: + group/ansible.eda.eda: + controller_host: "{{ controller_host }}" + controller_username: "{{ controller_username }}" + controller_password: "{{ controller_password }}" + validate_certs: "{{ controller_verify_ssl }}" + block: + - name: Generate a random_string for the test + set_fact: + random_string: "{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}" + when: random_string is not defined + + - name: Generate a ID for the test + set_fact: + test_id: "{{ random_string | to_uuid }}" + when: test_id is not defined + + - name: Define variables for credential and project + set_fact: + credential_name: "Test_Credential_{{ test_id }}" + new_credential_name: "New_Test_Credential_{{ test_id }}" + credential_type_name: "Test_CredentialType_{{ test_id }}" + + # CREATE + - name: Create credential type + ansible.eda.credential_type: + name: "{{ credential_type_name }}" + state: present + description: "A test credential type" + inputs: + fields: + - id: "field1" + type: "string" + label: "Field 5" + injectors: + extra_vars: field1: "field1" - organization_name: Default - register: _result - - # [WARNING]: The field inputs of unknown 3 has encrypted data and may inaccurately report task is changed. - - name: Check credential is not updated again - assert: - that: - - not _result.changed - ignore_errors: true - - - name: Get info about credential - ansible.eda.credential_info: - <<: *credential_defaults - name: "{{ new_credential_name }}" - - - name: List all credentials - ansible.eda.credential_info: - <<: *credential_defaults - - # DELETE - - name: Delete operation type without required name parameter - ansible.eda.credential: - <<: *credential_defaults - state: absent - ignore_errors: true - register: _result - - - name: Check if credential name is required - assert: - that: - - _result.failed - - "'missing required arguments: name' in _result.msg" - - - name: Delete non-existing credential in check mode - ansible.eda.credential: - <<: *credential_defaults - name: "Example2" - state: absent - check_mode: true - register: _result - - - name: Check if delete non-existing credential in check mode - assert: - that: - - not _result.changed - - - name: Delete credential - ansible.eda.credential: - <<: *credential_defaults - name: "{{ new_credential_name }}" - state: absent - register: _result - - - name: Check if delete non-existing credential - assert: - that: - - _result.changed + - name: Create credential in check mode + ansible.eda.credential: + state: present + name: "{{ credential_name }}" + description: "This is a test credential" + credential_type_name: "{{ credential_type_name }}" + inputs: + field1: "field1" + organization_name: Default + check_mode: true + register: _result + + - name: Check credential creation in check mode + assert: + that: + - _result.changed + + - name: Create credential + ansible.eda.credential: + state: present + name: "{{ credential_name }}" + description: "This is a test credential" + credential_type_name: "{{ credential_type_name }}" + inputs: + field1: "field1" + organization_name: Default + register: _result + + - name: Check credential creation + assert: + that: + - _result.changed + + - name: Create credential again + ansible.eda.credential: + state: present + name: "{{ credential_name }}" + description: "This is a test credential" + credential_type_name: "{{ credential_type_name }}" + inputs: + field1: "field1" + organization_name: Default + register: _result + + # [WARNING]: The field inputs of unknown 3 has encrypted data and may inaccurately report task is changed. + - name: Check credential is not created again + assert: + that: + - not _result.changed + ignore_errors: true + + - name: Get info about a credential + ansible.eda.credential_info: + name: "{{ credential_name }}" + + # UPDATE + - name: Update credential name + ansible.eda.credential: + state: present + name: "{{ new_credential_name }}" + description: "This is a test credential" + credential_type_name: "{{ credential_type_name }}" + inputs: + field1: "field1" + organization_name: Default + register: _result + + - name: Check credential update + assert: + that: + - _result.changed + + - name: Update credential again + ansible.eda.credential: + state: present + name: "{{ new_credential_name }}" + description: "This is a test credential" + credential_type_name: "{{ credential_type_name }}" + inputs: + field1: "field1" + organization_name: Default + register: _result + + # [WARNING]: The field inputs of unknown 3 has encrypted data and may inaccurately report task is changed. + - name: Check credential is not updated again + assert: + that: + - not _result.changed + ignore_errors: true + + - name: Get info about credential + ansible.eda.credential_info: + name: "{{ new_credential_name }}" + + - name: List all credentials + ansible.eda.credential_info: + + # DELETE + - name: Delete operation type without required name parameter + ansible.eda.credential: + state: absent + ignore_errors: true + register: _result + + - name: Check if credential name is required + assert: + that: + - _result.failed + - "'missing required arguments: name' in _result.msg" + + - name: Delete non-existing credential in check mode + ansible.eda.credential: + name: "Example2" + state: absent + check_mode: true + register: _result + + - name: Check if delete non-existing credential in check mode + assert: + that: + - not _result.changed + + - name: Delete credential + ansible.eda.credential: + name: "{{ new_credential_name }}" + state: absent + register: _result + + - name: Check if delete non-existing credential + assert: + that: + - _result.changed always: - name: Clean up - credential ansible.eda.credential: - <<: *credential_defaults name: "{{ item }}" state: absent loop: @@ -197,7 +182,6 @@ - name: Clean up - credential type ansible.eda.credential_type: - <<: *credential_defaults name: "{{ credential_type_name }}" state: absent ignore_errors: true diff --git a/tests/integration/targets/credential_type/tasks/main.yml b/tests/integration/targets/credential_type/tasks/main.yml index 503ed34f..a3f1a759 100644 --- a/tests/integration/targets/credential_type/tasks/main.yml +++ b/tests/integration/targets/credential_type/tasks/main.yml @@ -1,186 +1,175 @@ --- -- block: - - set_fact: - credential_defaults: &credential_defaults - controller_username: "{{ controller_username }}" - controller_password: "{{ controller_password }}" - controller_host: "{{ controller_host }}" - validate_certs: false - no_log: true - - - name: Generate a random_string for the test - set_fact: - random_string: "{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}" - when: random_string is not defined - - - name: Generate a ID for the test - set_fact: - test_id: "{{ random_string | to_uuid }}" - when: test_id is not defined - - - name: Define variables for credential and project - set_fact: - credential_type_name: "Test_CredentialType_{{ test_id }}" - new_credential_type_name: "New_Test_CredentialType_{{ test_id }}" - - # CREATE - - name: Create credential type in check mode - ansible.eda.credential_type: - <<: *credential_defaults - name: "{{ credential_type_name }}" - state: present - description: "A test credential type" - inputs: - fields: - - id: "field1" - type: "string" - label: "Field 5" - injectors: - extra_vars: - field1: "field1" - check_mode: true - register: _result - - - name: Check credential type creation in check mode - assert: - that: - - _result.changed - - - name: Create credential type - ansible.eda.credential_type: - <<: *credential_defaults - name: "{{ credential_type_name }}" - state: present - description: "A test credential type" - inputs: - fields: - - id: "field1" - type: "string" - label: "Field 5" - injectors: - extra_vars: - field1: "field1" - register: _result - - - name: Check credential type creation - assert: - that: - - _result.changed - - - name: Create credential type again - ansible.eda.credential_type: - <<: *credential_defaults - name: "{{ credential_type_name }}" - state: present - description: "A test credential type" - inputs: - fields: - - id: "field1" - type: "string" - label: "Field 5" - injectors: - extra_vars: - field1: "field1" - register: _result - - - name: Check credential type is not created again - assert: - that: - - not _result.changed - - - name: Get info about a credential type - ansible.eda.credential_type_info: - <<: *credential_defaults - name: "{{ credential_type_name }}" - - # UPDATE - - name: Update credential type name - ansible.eda.credential_type: - <<: *credential_defaults - name: "{{ credential_type_name }}" - new_name: "{{ new_credential_type_name }}" - state: present - description: "A test credential type" - inputs: - fields: - - id: "field1" - type: "string" - label: "Field 5" - injectors: - extra_vars: - field1: "field1" - register: _result - - - name: Check credential type update - assert: - that: - - _result.changed - - - name: Update credential type again - ansible.eda.credential_type: - <<: *credential_defaults - name: "{{ new_credential_type_name }}" - new_name: "{{ new_credential_type_name }}" - state: present - description: "A test credential type" - inputs: - fields: - - id: "field1" - type: "string" - label: "Field 5" - injectors: - extra_vars: - field1: "field1" - register: _result - - - name: Check credential type is not updated again - assert: - that: - - not _result.changed - - # DELETE - - name: Delete operation type without required name parameter - ansible.eda.credential_type: - <<: *credential_defaults - state: absent - ignore_errors: true - register: _result - - - name: Check if credential type name is required - assert: - that: - - _result.failed - - "'missing required arguments: name' in _result.msg" - - - name: Delete non-existing credential type in check mode - ansible.eda.credential_type: - <<: *credential_defaults - name: "Example2" - state: absent - check_mode: true - register: _result - - - name: Check if delete non-existing credential type in check mode - assert: - that: - - not _result.changed - - - name: Delete credential type - ansible.eda.credential_type: - <<: *credential_defaults - name: "{{ new_credential_type_name }}" - state: absent - register: _result - - - name: Check if delete non-existing credential type - assert: - that: - - _result.changed +- name: Credential type integration tests + module_defaults: + group/ansible.eda.eda: + controller_host: "{{ controller_host }}" + controller_username: "{{ controller_username }}" + controller_password: "{{ controller_password }}" + validate_certs: "{{ controller_verify_ssl }}" + block: + - name: Generate a random_string for the test + set_fact: + random_string: "{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}" + when: random_string is not defined + + - name: Generate a ID for the test + set_fact: + test_id: "{{ random_string | to_uuid }}" + when: test_id is not defined + + - name: Define variables for credential and project + set_fact: + credential_type_name: "Test_CredentialType_{{ test_id }}" + new_credential_type_name: "New_Test_CredentialType_{{ test_id }}" + + # CREATE + - name: Create credential type in check mode + ansible.eda.credential_type: + name: "{{ credential_type_name }}" + state: present + description: "A test credential type" + inputs: + fields: + - id: "field1" + type: "string" + label: "Field 5" + injectors: + extra_vars: + field1: "field1" + check_mode: true + register: _result + + - name: Check credential type creation in check mode + assert: + that: + - _result.changed + + - name: Create credential type + ansible.eda.credential_type: + name: "{{ credential_type_name }}" + state: present + description: "A test credential type" + inputs: + fields: + - id: "field1" + type: "string" + label: "Field 5" + injectors: + extra_vars: + field1: "field1" + register: _result + + - name: Check credential type creation + assert: + that: + - _result.changed + + - name: Create credential type again + ansible.eda.credential_type: + name: "{{ credential_type_name }}" + state: present + description: "A test credential type" + inputs: + fields: + - id: "field1" + type: "string" + label: "Field 5" + injectors: + extra_vars: + field1: "field1" + register: _result + + - name: Check credential type is not created again + assert: + that: + - not _result.changed + + - name: Get info about a credential type + ansible.eda.credential_type_info: + name: "{{ credential_type_name }}" + + # UPDATE + - name: Update credential type name + ansible.eda.credential_type: + name: "{{ credential_type_name }}" + new_name: "{{ new_credential_type_name }}" + state: present + description: "A test credential type" + inputs: + fields: + - id: "field1" + type: "string" + label: "Field 5" + injectors: + extra_vars: + field1: "field1" + register: _result + + - name: Check credential type update + assert: + that: + - _result.changed + + - name: Update credential type again + ansible.eda.credential_type: + name: "{{ new_credential_type_name }}" + new_name: "{{ new_credential_type_name }}" + state: present + description: "A test credential type" + inputs: + fields: + - id: "field1" + type: "string" + label: "Field 5" + injectors: + extra_vars: + field1: "field1" + register: _result + + - name: Check credential type is not updated again + assert: + that: + - not _result.changed + + # DELETE + - name: Delete operation type without required name parameter + ansible.eda.credential_type: + state: absent + ignore_errors: true + register: _result + + - name: Check if credential type name is required + assert: + that: + - _result.failed + - "'missing required arguments: name' in _result.msg" + + - name: Delete non-existing credential type in check mode + ansible.eda.credential_type: + name: "Example2" + state: absent + check_mode: true + register: _result + + - name: Check if delete non-existing credential type in check mode + assert: + that: + - not _result.changed + + - name: Delete credential type + ansible.eda.credential_type: + name: "{{ new_credential_type_name }}" + state: absent + register: _result + + - name: Check if delete non-existing credential type + assert: + that: + - _result.changed always: - name: Clean up - credential type ansible.eda.credential_type: - <<: *credential_defaults name: "{{ item }}" state: absent loop: diff --git a/tests/integration/targets/decision_environment/tasks/create.yml b/tests/integration/targets/decision_environment/tasks/create.yml index 83fb976b..037ce439 100644 --- a/tests/integration/targets/decision_environment/tasks/create.yml +++ b/tests/integration/targets/decision_environment/tasks/create.yml @@ -4,10 +4,6 @@ - name: Create decision environment in check mode ansible.eda.decision_environment: - controller_host: "{{ controller_host }}" - controller_username: "{{ controller_username }}" - controller_password: "{{ controller_password }}" - validate_certs: "{{ controller_verify_ssl }}" name: "{{ decision_env_name }}" description: "Example decision environment description" image_url: "{{ image_url }}" @@ -23,10 +19,6 @@ - name: Create decision environment ansible.eda.decision_environment: - controller_host: "{{ controller_host }}" - controller_username: "{{ controller_username }}" - controller_password: "{{ controller_password }}" - validate_certs: "{{ controller_verify_ssl }}" name: "{{ decision_env_name }}" description: "Example decision environment description" image_url: "{{ image_url }}" @@ -41,10 +33,6 @@ - name: Create decision environment again ansible.eda.decision_environment: - controller_host: "{{ controller_host }}" - controller_username: "{{ controller_username }}" - controller_password: "{{ controller_password }}" - validate_certs: "{{ controller_verify_ssl }}" name: "{{ decision_env_name }}" description: "Example decision environment description" image_url: "{{ image_url }}" @@ -59,10 +47,6 @@ - name: Delete decision environment in check mode ansible.eda.decision_environment: - controller_host: "{{ controller_host }}" - controller_username: "{{ controller_username }}" - controller_password: "{{ controller_password }}" - validate_certs: "{{ controller_verify_ssl }}" name: "{{ decision_env_name }}" state: absent check_mode: true @@ -75,10 +59,6 @@ - name: Delete decision environment ansible.eda.decision_environment: - controller_host: "{{ controller_host }}" - controller_username: "{{ controller_username }}" - controller_password: "{{ controller_password }}" - validate_certs: "{{ controller_verify_ssl }}" name: "{{ decision_env_name }}" state: absent register: r diff --git a/tests/integration/targets/decision_environment/tasks/delete.yml b/tests/integration/targets/decision_environment/tasks/delete.yml index 399c1657..b5e765b7 100644 --- a/tests/integration/targets/decision_environment/tasks/delete.yml +++ b/tests/integration/targets/decision_environment/tasks/delete.yml @@ -4,10 +4,6 @@ - name: Delete operation without required name parameter ansible.eda.decision_environment: - controller_host: "{{ controller_host }}" - controller_username: "{{ controller_username }}" - controller_password: "{{ controller_password }}" - validate_certs: "{{ controller_verify_ssl }}" state: absent ignore_errors: true register: r @@ -20,10 +16,6 @@ - name: Delete non-existing decision environment in check mode ansible.eda.decision_environment: - controller_host: "{{ controller_host }}" - controller_username: "{{ controller_username }}" - controller_password: "{{ controller_password }}" - validate_certs: "{{ controller_verify_ssl }}" name: Example state: absent check_mode: true @@ -36,10 +28,6 @@ - name: Delete non-existing decision environment ansible.eda.decision_environment: - controller_host: "{{ controller_host }}" - controller_username: "{{ controller_username }}" - controller_password: "{{ controller_password }}" - validate_certs: "{{ controller_verify_ssl }}" name: Example state: absent register: r diff --git a/tests/integration/targets/decision_environment/tasks/main.yml b/tests/integration/targets/decision_environment/tasks/main.yml index 4c0687c1..b4ffc8d5 100644 --- a/tests/integration/targets/decision_environment/tasks/main.yml +++ b/tests/integration/targets/decision_environment/tasks/main.yml @@ -2,7 +2,14 @@ # Copyright: Contributors to the Ansible project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -- block: +- name: Decision environment integration tests + module_defaults: + group/ansible.eda.eda: + controller_host: "{{ controller_host }}" + controller_username: "{{ controller_username }}" + controller_password: "{{ controller_password }}" + validate_certs: "{{ controller_verify_ssl }}" + block: - name: Generate a random_string for the test set_fact: random_string: "{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}" @@ -24,10 +31,6 @@ always: - name: Clean up - decision environment ansible.eda.decision_environment: - controller_host: "{{ controller_host }}" - controller_username: "{{ controller_username }}" - controller_password: "{{ controller_password }}" - validate_certs: "{{ controller_verify_ssl }}" name: "{{ item }}" state: absent loop: diff --git a/tests/integration/targets/decision_environment/tasks/update.yml b/tests/integration/targets/decision_environment/tasks/update.yml index f7a01d7b..c324def0 100644 --- a/tests/integration/targets/decision_environment/tasks/update.yml +++ b/tests/integration/targets/decision_environment/tasks/update.yml @@ -4,10 +4,6 @@ - name: Create decision environment ansible.eda.decision_environment: - controller_host: "{{ controller_host }}" - controller_username: "{{ controller_username }}" - controller_password: "{{ controller_password }}" - validate_certs: "{{ controller_verify_ssl }}" name: "{{ decision_env_name }}" description: "Example decision environment description" image_url: "{{ image_url }}" @@ -22,10 +18,6 @@ - name: Update decision environment name ansible.eda.decision_environment: - controller_host: "{{ controller_host }}" - controller_username: "{{ controller_username }}" - controller_password: "{{ controller_password }}" - validate_certs: "{{ controller_verify_ssl }}" name: "{{ decision_env_name }}" new_name: "{{ decision_env_name }}_new" description: "Example decision environment description" @@ -41,10 +33,6 @@ - name: Update decision environment again ansible.eda.decision_environment: - controller_host: "{{ controller_host }}" - controller_username: "{{ controller_username }}" - controller_password: "{{ controller_password }}" - validate_certs: "{{ controller_verify_ssl }}" name: "{{ decision_env_name }}_new" new_name: "{{ decision_env_name }}_new" description: "Example decision environment description" @@ -60,10 +48,6 @@ - name: Delete updated decision environment ansible.eda.decision_environment: - controller_host: "{{ controller_host }}" - controller_username: "{{ controller_username }}" - controller_password: "{{ controller_password }}" - validate_certs: "{{ controller_verify_ssl }}" name: "{{ decision_env_name }}_new" state: absent register: r diff --git a/tests/integration/targets/decision_environment_info/tasks/list.yml b/tests/integration/targets/decision_environment_info/tasks/list.yml index 7b677752..cef195ad 100644 --- a/tests/integration/targets/decision_environment_info/tasks/list.yml +++ b/tests/integration/targets/decision_environment_info/tasks/list.yml @@ -4,10 +4,6 @@ - name: Create decision environment ansible.eda.decision_environment: - controller_host: "{{ controller_host }}" - controller_username: "{{ controller_username }}" - controller_password: "{{ controller_password }}" - validate_certs: "{{ controller_verify_ssl }}" name: "{{ decision_env_name }}" description: "Example decision environment description" image_url: "{{ image_url }}" @@ -22,10 +18,6 @@ - name: List all decision environments in check mode ansible.eda.decision_environment_info: - controller_host: "{{ controller_host }}" - controller_username: "{{ controller_username }}" - controller_password: "{{ controller_password }}" - validate_certs: "{{ controller_verify_ssl }}" check_mode: true register: r @@ -37,10 +29,6 @@ - name: List all decision environments ansible.eda.decision_environment_info: - controller_host: "{{ controller_host }}" - controller_username: "{{ controller_username }}" - controller_password: "{{ controller_password }}" - validate_certs: "{{ controller_verify_ssl }}" register: r - name: Check if list decision environments @@ -51,10 +39,6 @@ - name: List a particular decision environment ansible.eda.decision_environment_info: - controller_host: "{{ controller_host }}" - controller_username: "{{ controller_username }}" - controller_password: "{{ controller_password }}" - validate_certs: "{{ controller_verify_ssl }}" name: "{{ decision_env_name }}" register: r @@ -67,10 +51,6 @@ - name: Delete decision environment ansible.eda.decision_environment: - controller_host: "{{ controller_host }}" - controller_username: "{{ controller_username }}" - controller_password: "{{ controller_password }}" - validate_certs: "{{ controller_verify_ssl }}" name: "{{ decision_env_name }}" state: absent register: r diff --git a/tests/integration/targets/decision_environment_info/tasks/main.yml b/tests/integration/targets/decision_environment_info/tasks/main.yml index dc00a483..bbae844c 100644 --- a/tests/integration/targets/decision_environment_info/tasks/main.yml +++ b/tests/integration/targets/decision_environment_info/tasks/main.yml @@ -2,7 +2,15 @@ # Copyright: Contributors to the Ansible project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -- block: +- name: Decision environment info module integration tests + module_defaults: + group/ansible.eda.eda: + controller_host: "{{ controller_host }}" + controller_username: "{{ controller_username }}" + controller_password: "{{ controller_password }}" + validate_certs: "{{ controller_verify_ssl }}" + + block: - name: Generate a random_string for the test set_fact: random_string: "{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}" @@ -22,10 +30,6 @@ always: - name: Clean up - decision environment ansible.eda.decision_environment: - controller_host: "{{ controller_host }}" - controller_username: "{{ controller_username }}" - controller_password: "{{ controller_password }}" - validate_certs: "{{ controller_verify_ssl }}" name: "{{ item }}" state: absent loop: diff --git a/tests/integration/targets/project/tasks/create.yml b/tests/integration/targets/project/tasks/create.yml index 4bd201c2..ffda25f9 100644 --- a/tests/integration/targets/project/tasks/create.yml +++ b/tests/integration/targets/project/tasks/create.yml @@ -4,10 +4,6 @@ - name: Create project in check mode ansible.eda.project: - controller_host: "{{ controller_host }}" - controller_username: "{{ controller_username }}" - controller_password: "{{ controller_password }}" - validate_certs: "{{ controller_verify_ssl }}" name: "{{ project_name }}" url: "{{ url }}" description: "Example project description" @@ -23,10 +19,6 @@ - name: Create project ansible.eda.project: - controller_host: "{{ controller_host }}" - controller_username: "{{ controller_username }}" - controller_password: "{{ controller_password }}" - validate_certs: "{{ controller_verify_ssl }}" name: "{{ project_name }}" url: "{{ url }}" description: "Example project description" @@ -41,10 +33,6 @@ - name: Create project again ansible.eda.project: - controller_host: "{{ controller_host }}" - controller_username: "{{ controller_username }}" - controller_password: "{{ controller_password }}" - validate_certs: "{{ controller_verify_ssl }}" name: "{{ project_name }}" url: "{{ url }}" description: "Example project description" @@ -59,10 +47,6 @@ - name: Delete project in check mode ansible.eda.project: - controller_host: "{{ controller_host }}" - controller_username: "{{ controller_username }}" - controller_password: "{{ controller_password }}" - validate_certs: "{{ controller_verify_ssl }}" name: "{{ project_name }}" state: absent check_mode: true @@ -75,10 +59,6 @@ - name: Delete project ansible.eda.project: - controller_host: "{{ controller_host }}" - controller_username: "{{ controller_username }}" - controller_password: "{{ controller_password }}" - validate_certs: "{{ controller_verify_ssl }}" name: "{{ project_name }}" state: absent register: r diff --git a/tests/integration/targets/project/tasks/delete.yml b/tests/integration/targets/project/tasks/delete.yml index 458f27c8..fbcf1a68 100644 --- a/tests/integration/targets/project/tasks/delete.yml +++ b/tests/integration/targets/project/tasks/delete.yml @@ -35,10 +35,6 @@ - name: Delete non-existing project ansible.eda.project: - controller_host: "{{ controller_host }}" - controller_username: "{{ controller_username }}" - controller_password: "{{ controller_password }}" - validate_certs: "{{ controller_verify_ssl }}" name: "{{ project_name }}_ee" state: absent register: r diff --git a/tests/integration/targets/project/tasks/main.yml b/tests/integration/targets/project/tasks/main.yml index 2930aed7..a7fc5193 100644 --- a/tests/integration/targets/project/tasks/main.yml +++ b/tests/integration/targets/project/tasks/main.yml @@ -1,8 +1,14 @@ --- # Copyright: Contributors to the Ansible project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) - -- block: +- name: Project integration tests + module_defaults: + group/ansible.eda.eda: + controller_host: "{{ controller_host }}" + controller_username: "{{ controller_username }}" + controller_password: "{{ controller_password }}" + validate_certs: "{{ controller_verify_ssl }}" + block: - name: Generate a random_string for the test set_fact: random_string: "{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}" @@ -24,10 +30,6 @@ always: - name: Clean up - project ansible.eda.project: - controller_host: "{{ controller_host }}" - controller_username: "{{ controller_username }}" - controller_password: "{{ controller_password }}" - validate_certs: "{{ controller_verify_ssl }}" name: "{{ item }}" state: absent loop: diff --git a/tests/integration/targets/project/tasks/update.yml b/tests/integration/targets/project/tasks/update.yml index 2b82fae5..7bc73b7a 100644 --- a/tests/integration/targets/project/tasks/update.yml +++ b/tests/integration/targets/project/tasks/update.yml @@ -4,10 +4,6 @@ - name: Create project ansible.eda.project: - controller_host: "{{ controller_host }}" - controller_username: "{{ controller_username }}" - controller_password: "{{ controller_password }}" - validate_certs: "{{ controller_verify_ssl }}" name: "{{ project_name }}" url: "{{ url }}" description: "Example project description" @@ -22,10 +18,6 @@ - name: Update project name ansible.eda.project: - controller_host: "{{ controller_host }}" - controller_username: "{{ controller_username }}" - controller_password: "{{ controller_password }}" - validate_certs: "{{ controller_verify_ssl }}" name: "{{ project_name }}" url: "{{ url }}" new_name: "{{ project_name }}_new" @@ -41,10 +33,6 @@ - name: Update project again ansible.eda.project: - controller_host: "{{ controller_host }}" - controller_username: "{{ controller_username }}" - controller_password: "{{ controller_password }}" - validate_certs: "{{ controller_verify_ssl }}" name: "{{ project_name }}_new" new_name: "{{ project_name }}_new" description: "Example project description" @@ -60,10 +48,6 @@ - name: Delete updated project ansible.eda.project: - controller_host: "{{ controller_host }}" - controller_username: "{{ controller_username }}" - controller_password: "{{ controller_password }}" - validate_certs: "{{ controller_verify_ssl }}" name: "{{ project_name }}_new" state: absent register: r diff --git a/tests/integration/targets/project_info/tasks/create.yml b/tests/integration/targets/project_info/tasks/create.yml index 955f2454..36e1d0ca 100644 --- a/tests/integration/targets/project_info/tasks/create.yml +++ b/tests/integration/targets/project_info/tasks/create.yml @@ -4,10 +4,6 @@ - name: Create a project ansible.eda.project: - controller_host: "{{ controller_host }}" - controller_username: "{{ controller_username }}" - controller_password: "{{ controller_password }}" - validate_certs: "{{ controller_verify_ssl }}" name: Example description: "Example project description" url: "https://example.com/project1" diff --git a/tests/integration/targets/project_info/tasks/main.yml b/tests/integration/targets/project_info/tasks/main.yml index eb45420c..b8f05605 100644 --- a/tests/integration/targets/project_info/tasks/main.yml +++ b/tests/integration/targets/project_info/tasks/main.yml @@ -2,14 +2,18 @@ # Copyright: Contributors to the Ansible project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -- block: +- name: Project info module integration tests + module_defaults: + group/ansible.eda.eda: + controller_host: "{{ controller_host }}" + controller_username: "{{ controller_username }}" + controller_password: "{{ controller_password }}" + validate_certs: "{{ controller_verify_ssl }}" + + block: - include_tasks: create.yml - name: List all projects in the given EDA Controller in check mode ansible.eda.project_info: - controller_host: "{{ controller_host }}" - controller_username: "{{ controller_username }}" - controller_password: "{{ controller_password }}" - validate_certs: "{{ controller_verify_ssl }}" check_mode: true register: r @@ -20,10 +24,6 @@ - name: List all projects in the given EDA Controller ansible.eda.project_info: - controller_host: "{{ controller_host }}" - controller_username: "{{ controller_username }}" - controller_password: "{{ controller_password }}" - validate_certs: "{{ controller_verify_ssl }}" register: r - name: Check if all the projects are returned @@ -33,10 +33,6 @@ - name: List a particular project in the given EDA Controller ansible.eda.project_info: - controller_host: "{{ controller_host }}" - controller_username: "{{ controller_username }}" - controller_password: "{{ controller_password }}" - validate_certs: "{{ controller_verify_ssl }}" name: "Example" register: r @@ -48,10 +44,6 @@ - name: List a non-existing particular project in the given EDA Controller ansible.eda.project_info: - controller_host: "{{ controller_host }}" - controller_username: "{{ controller_username }}" - controller_password: "{{ controller_password }}" - validate_certs: "{{ controller_verify_ssl }}" name: "Example2" register: r @@ -64,10 +56,6 @@ always: - name: Clean up - project ansible.eda.project: - controller_host: "{{ controller_host }}" - controller_username: "{{ controller_username }}" - controller_password: "{{ controller_password }}" - validate_certs: "{{ controller_verify_ssl }}" name: "{{ item }}" state: absent loop: diff --git a/tests/integration/targets/user/tasks/create.yml b/tests/integration/targets/user/tasks/create.yml index b1c310e2..3fc26628 100644 --- a/tests/integration/targets/user/tasks/create.yml +++ b/tests/integration/targets/user/tasks/create.yml @@ -4,10 +4,6 @@ - name: Create super user in check mode ansible.eda.user: - controller_host: "{{ controller_host }}" - controller_username: "{{ controller_username }}" - controller_password: "{{ controller_password }}" - validate_certs: "{{ controller_verify_ssl }}" username: "{{ user_name }}" first_name: "{{ first_name }}" last_name: "{{ last_name }}" @@ -25,10 +21,6 @@ - name: Create super user ansible.eda.user: - controller_host: "{{ controller_host }}" - controller_username: "{{ controller_username }}" - controller_password: "{{ controller_password }}" - validate_certs: "{{ controller_verify_ssl }}" username: "{{ user_name }}" first_name: "{{ first_name }}" last_name: "{{ last_name }}" @@ -45,10 +37,6 @@ - name: Create super user again ansible.eda.user: - controller_host: "{{ controller_host }}" - controller_username: "{{ controller_username }}" - controller_password: "{{ controller_password }}" - validate_certs: "{{ controller_verify_ssl }}" username: "{{ user_name }}" first_name: "{{ first_name }}" last_name: "{{ last_name }}" @@ -65,10 +53,6 @@ - name: Delete super user ansible.eda.user: - controller_host: "{{ controller_host }}" - controller_username: "{{ controller_username }}" - controller_password: "{{ controller_password }}" - vvalidate_certs: "{{ controller_verify_ssl }}" username: "{{ user_name }}" state: absent register: r @@ -80,10 +64,6 @@ - name: Create normal user in check mode ansible.eda.user: - controller_host: "{{ controller_host }}" - controller_username: "{{ controller_username }}" - controller_password: "{{ controller_password }}" - validate_certs: "{{ controller_verify_ssl }}" username: "{{ user_name }}" first_name: "{{ first_name }}" last_name: "{{ last_name }}" @@ -101,10 +81,6 @@ - name: Create normal user ansible.eda.user: - controller_host: "{{ controller_host }}" - controller_username: "{{ controller_username }}" - controller_password: "{{ controller_password }}" - validate_certs: "{{ controller_verify_ssl }}" username: "{{ user_name }}" first_name: "{{ first_name }}" last_name: "{{ last_name }}" @@ -121,10 +97,6 @@ - name: Create normal user again ansible.eda.user: - controller_host: "{{ controller_host }}" - controller_username: "{{ controller_username }}" - controller_password: "{{ controller_password }}" - validate_certs: "{{ controller_verify_ssl }}" username: "{{ user_name }}" first_name: "{{ first_name }}" last_name: "{{ last_name }}" @@ -141,10 +113,6 @@ - name: Delete normal user ansible.eda.user: - controller_host: "{{ controller_host }}" - controller_username: "{{ controller_username }}" - controller_password: "{{ controller_password }}" - validate_certs: "{{ controller_verify_ssl }}" username: "{{ user_name }}" state: absent register: r diff --git a/tests/integration/targets/user/tasks/main.yml b/tests/integration/targets/user/tasks/main.yml index 08ebb423..b1303b6e 100644 --- a/tests/integration/targets/user/tasks/main.yml +++ b/tests/integration/targets/user/tasks/main.yml @@ -2,7 +2,14 @@ # Copyright: Contributors to the Ansible project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -- block: +- name: User integration tests + module_defaults: + group/ansible.eda.eda: + controller_host: "{{ controller_host }}" + controller_username: "{{ controller_username }}" + controller_password: "{{ controller_password }}" + validate_certs: "{{ controller_verify_ssl }}" + block: - name: Generate a random_string for the test set_fact: random_string: "{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}" @@ -20,10 +27,6 @@ always: - name: Clean up - user ansible.eda.project: - controller_host: "{{ controller_host }}" - controller_username: "{{ controller_username }}" - controller_password: "{{ controller_password }}" - validate_certs: "{{ controller_verify_ssl }}" name: "{{ item }}" state: absent loop: diff --git a/tests/integration/targets/user/tasks/update.yml b/tests/integration/targets/user/tasks/update.yml index c831616b..f77226f0 100644 --- a/tests/integration/targets/user/tasks/update.yml +++ b/tests/integration/targets/user/tasks/update.yml @@ -4,10 +4,6 @@ - name: Create super user ansible.eda.user: - controller_host: "{{ controller_host }}" - controller_username: "{{ controller_username }}" - controller_password: "{{ controller_password }}" - validate_certs: "{{ controller_verify_ssl }}" username: "{{ user_name }}" first_name: "{{ first_name }}" last_name: "{{ last_name }}" @@ -24,10 +20,6 @@ - name: Update super user ansible.eda.user: - controller_host: "{{ controller_host }}" - controller_username: "{{ controller_username }}" - controller_password: "{{ controller_password }}" - validate_certs: "{{ controller_verify_ssl }}" username: "{{ user_name }}" new_username: "{{ user_name }}_new" first_name: "{{ first_name }}_new" @@ -45,10 +37,6 @@ - name: Delete super user ansible.eda.user: - controller_host: "{{ controller_host }}" - controller_username: "{{ controller_username }}" - controller_password: "{{ controller_password }}" - validate_certs: "{{ controller_verify_ssl }}" username: "{{ user_name }}_new" state: absent register: r