Skip to content

Commit

Permalink
Ensure the mandatory fields required by the EDA API are respcted with…
Browse files Browse the repository at this point in the history
…in the modules

Signed-off-by: Alina Buzachis <abuzachis@redhat.com>
  • Loading branch information
alinabuzachis committed Sep 12, 2024
1 parent 5659368 commit c58fa34
Show file tree
Hide file tree
Showing 14 changed files with 40 additions and 37 deletions.
8 changes: 4 additions & 4 deletions plugins/modules/activation.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
__metaclass__ = type


DOCUMENTATION = """
DOCUMENTATION = r"""
---
module: activation
author:
Expand Down Expand Up @@ -133,7 +133,7 @@
not perform any modification when an existing rulebook activation is found.
"""

EXAMPLES = """
EXAMPLES = r"""
- name: Create a rulebook activation
ansible.eda.activation:
name: "Example Rulebook Activation"
Expand All @@ -151,7 +151,7 @@
"""


RETURN = """
RETURN = r"""
id:
description: ID of the rulebook activation.
returned: when exists
Expand Down Expand Up @@ -315,7 +315,7 @@ def main() -> None:
(
"state",
"present",
("name", "rulebook_name", "decision_environment_name"),
("name", "rulebook_name", "decision_environment_name", "project_name"),
)
]

Expand Down
6 changes: 3 additions & 3 deletions plugins/modules/activation_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
__metaclass__ = type


DOCUMENTATION = """
DOCUMENTATION = r"""
---
module: activation_info
author:
Expand All @@ -29,7 +29,7 @@
"""


EXAMPLES = """
EXAMPLES = r"""
- name: Get information about a rulebook activation
ansible.eda.activation_info:
name: "Example Rulebook Activation"
Expand All @@ -39,7 +39,7 @@
"""


RETURN = """
RETURN = r"""
activations:
description: Information about rulebook activations.
returned: always
Expand Down
6 changes: 3 additions & 3 deletions plugins/modules/controller_token.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

__metaclass__ = type

DOCUMENTATION = """
DOCUMENTATION = r"""
---
module: controller_token
author:
Expand Down Expand Up @@ -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/
Expand All @@ -69,7 +69,7 @@
"""


RETURN = """
RETURN = r"""
id:
description: ID of the managed AWX token.
returned: when state is 'present' and successful
Expand Down
6 changes: 3 additions & 3 deletions plugins/modules/credential.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
__metaclass__ = type


DOCUMENTATION = """
DOCUMENTATION = r"""
---
module: credential
author:
Expand Down Expand Up @@ -61,7 +61,7 @@
"""


EXAMPLES = """
EXAMPLES = r"""
- name: Create an EDA Credential
ansible.eda.credential:
name: "Example Credential"
Expand All @@ -78,7 +78,7 @@
"""


RETURN = """
RETURN = r"""
id:
description: ID of the credential.
returned: when exists
Expand Down
6 changes: 3 additions & 3 deletions plugins/modules/credential_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
__metaclass__ = type


DOCUMENTATION = """
DOCUMENTATION = r"""
---
module: credential_info
author:
Expand All @@ -31,7 +31,7 @@
"""


EXAMPLES = """
EXAMPLES = r"""
- name: Get information about a credential
ansible.eda.credential_info:
name: "Test"
Expand All @@ -41,7 +41,7 @@
"""


RETURN = """
RETURN = r"""
credentials:
description: Information about credentials.
returned: always
Expand Down
6 changes: 3 additions & 3 deletions plugins/modules/credential_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
__metaclass__ = type


DOCUMENTATION = """
DOCUMENTATION = r"""
---
module: credential_type
author:
Expand Down Expand Up @@ -53,7 +53,7 @@
"""


EXAMPLES = """
EXAMPLES = r"""
- name: Create a credential type
ansible.eda.credential_type:
name: "Test"
Expand All @@ -75,7 +75,7 @@
"""


RETURN = """
RETURN = r"""
id:
description: ID of the credential type.
returned: when exists
Expand Down
6 changes: 3 additions & 3 deletions plugins/modules/credential_type_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
__metaclass__ = type


DOCUMENTATION = """
DOCUMENTATION = r"""
---
module: credential_type_info
author:
Expand All @@ -31,7 +31,7 @@
"""


EXAMPLES = """
EXAMPLES = r"""
- name: Get information about a credential type
ansible.eda.credential_type_info:
name: "Test"
Expand All @@ -41,7 +41,7 @@
"""


RETURN = """
RETURN = r"""
credential_types:
description: Information about the credential types.
returned: always
Expand Down
6 changes: 3 additions & 3 deletions plugins/modules/decision_environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

__metaclass__ = type

DOCUMENTATION = """
DOCUMENTATION = r"""
---
module: decision_environment
author:
Expand Down Expand Up @@ -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/
Expand Down Expand Up @@ -89,7 +89,7 @@
state: absent
"""

RETURN = """
RETURN = r"""
id:
description: ID of the decision environment
returned: when exists
Expand Down
6 changes: 3 additions & 3 deletions plugins/modules/decision_environment_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

__metaclass__ = type

DOCUMENTATION = """
DOCUMENTATION = r"""
---
module: decision_environment_info
author:
Expand All @@ -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/
Expand All @@ -41,7 +41,7 @@
name: Example
"""

RETURN = """
RETURN = r"""
decision_environments:
description: List of dict containing information about decision environments
returned: when exists
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/event_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def main() -> None:
(
"state",
"present",
("name", "credential_name"),
("name", "credential_name", "event_stream_type"),
)
]

Expand Down
4 changes: 2 additions & 2 deletions plugins/modules/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

__metaclass__ = type

DOCUMENTATION = """
DOCUMENTATION = r"""
---
module: project
author:
Expand Down Expand Up @@ -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/
Expand Down
6 changes: 3 additions & 3 deletions plugins/modules/project_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

__metaclass__ = type

DOCUMENTATION = """
DOCUMENTATION = r"""
---
module: project_info
author:
Expand All @@ -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/
Expand All @@ -44,7 +44,7 @@
register: r
"""

RETURN = """
RETURN = r"""
projects:
description: List of dicts containing information about projects
returned: success
Expand Down
6 changes: 3 additions & 3 deletions plugins/modules/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

__metaclass__ = type

DOCUMENTATION = """
DOCUMENTATION = r"""
---
module: user
author:
Expand Down Expand Up @@ -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/
Expand Down Expand Up @@ -111,7 +111,7 @@
"""


RETURN = """
RETURN = r"""
id:
description: ID of the managed AWX token.
returned: when state is 'present' and successful
Expand Down
3 changes: 3 additions & 0 deletions tests/integration/targets/event_stream/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
name: "{{ event_stream_name }}"
credential_name: "{{ credential_name }}"
organization_name: Default
event_stream_type: "Basic Event Stream"
check_mode: true
register: _result

Expand All @@ -60,6 +61,7 @@
name: "{{ event_stream_name }}"
credential_name: "{{ credential_name }}"
organization_name: Default
event_stream_type: "Basic Event Stream"
register: _result

- name: Check event stream is not created again
Expand All @@ -73,6 +75,7 @@
name: "{{ event_stream_name }}"
credential_name: "{{ credential_name }}"
organization_name: Default
event_stream_type: "Basic Event Stream"
register: _result

# [WARNING]: The field eda_credential_id of unknown 2 has encrypted data and may
Expand Down

0 comments on commit c58fa34

Please sign in to comment.