diff --git a/plugins/modules/event_stream.py b/plugins/modules/event_stream.py index 94570ea7..97e48108 100644 --- a/plugins/modules/event_stream.py +++ b/plugins/modules/event_stream.py @@ -58,15 +58,12 @@ type: str default: '' version_added: 2.1.0 - test_mode: + forward_events: description: - Enable the event stream to forward events to the rulebook activation where it is configured. - - The O(forward_events) alias has been deprecated and will be removed in release 4.0.0. type: bool default: true version_added: 2.1.0 - aliases: - - forward_events state: description: - Desired state of the resource. @@ -120,8 +117,11 @@ def create_params(module: AnsibleModule, controller: Controller) -> dict[str, An if module.params.get("event_stream_type"): credential_params["event_stream_type"] = module.params["event_stream_type"] - if module.params.get("test_mode") is not None: - credential_params["test_mode"] = module.params["test_mode"] + if module.params.get("forward_events") is not None: + if module.params["forward_events"]: + credential_params["test_mode"] = False + else: + credential_params["test_mode"] = True if module.params.get("headers"): credential_params["additional_data_headers"] = module.params["headers"] @@ -159,18 +159,7 @@ def main() -> None: organization_name=dict(type="str", aliases=["organization"]), event_stream_type=dict(type="str", aliases=["type"]), headers=dict(type="str", default=""), - test_mode=dict( - type="bool", - default=True, - aliases=["forward_events"], - deprecated_aliases=[ - dict( - name="forward_events", - version="4.0.0", - collection_name="ansible.eda", - ) - ], - ), + forward_events=dict(type="bool", default=True), state=dict(choices=["present", "absent"], default="present"), ) diff --git a/tests/integration/targets/event_stream/tasks/main.yml b/tests/integration/targets/event_stream/tasks/main.yml index 134063b2..e7b03f9d 100644 --- a/tests/integration/targets/event_stream/tasks/main.yml +++ b/tests/integration/targets/event_stream/tasks/main.yml @@ -46,7 +46,7 @@ name: "{{ event_stream_name }}" credential_name: "{{ credential_name }}" organization_name: Default - test_mode: false + forward_events: false event_stream_type: Basic Event Stream check_mode: true register: _result @@ -133,7 +133,7 @@ that: - _result.event_streams[0].name == new_event_stream_name - - name: Update event stream headers and test_mode + - name: Update event stream headers and forward_events ansible.eda.event_stream: state: present name: "{{ new_event_stream_name }}" @@ -141,7 +141,7 @@ organization_name: Default event_stream_type: "Basic Event Stream" headers: "Authorization,Custom-Header" - test_mode: false + forward_events: false register: _result - name: Check event stream is updated @@ -154,12 +154,12 @@ name: "{{ new_event_stream_name }}" register: _result - - name: Check if event stream headers and test_mode are updated + - name: Check if event stream headers and forward_events are updated assert: that: - _result.event_streams[0].name == new_event_stream_name - _result.event_streams[0].additional_data_headers == "Authorization,Custom-Header" - - _result.event_streams[0].test_mode == False + - _result.event_streams[0].forward_events == True - name: List all event stream ansible.eda.event_stream_info: