diff --git a/plugins/modules/rulebook_activation.py b/plugins/modules/rulebook_activation.py index 9212ac8e..d5170ade 100644 --- a/plugins/modules/rulebook_activation.py +++ b/plugins/modules/rulebook_activation.py @@ -412,13 +412,13 @@ def create_params( if module.params.get("restart_policy"): activation_params["restart_policy"] = module.params["restart_policy"] - if module.params.get("enabled"): + if module.params.get("enabled") is not None: activation_params["is_enabled"] = module.params["enabled"] if not is_aap_24 and module.params.get("log_level"): activation_params["log_level"] = module.params["log_level"] - if not is_aap_24 and module.params.get("swap_single_source"): + if not is_aap_24 and module.params.get("swap_single_source") is not None: activation_params["swap_single_source"] = module.params["swap_single_source"] return activation_params diff --git a/tests/integration/targets/activation/tasks/main.yml b/tests/integration/targets/activation/tasks/main.yml index 6c94e461..2cae5f86 100644 --- a/tests/integration/targets/activation/tasks/main.yml +++ b/tests/integration/targets/activation/tasks/main.yml @@ -269,6 +269,12 @@ - name: Get information about the rulebook activation ansible.eda.rulebook_activation_info: name: "{{ activation_name }}" + register: _result_activation_info + + - name: Assert that rulebook activation is disabled + ansible.builtin.assert: + that: + - not _result_activation_info.activations[0].is_enabled - name: List all the rulebook activations ansible.eda.rulebook_activation_info: @@ -380,6 +386,7 @@ enabled: False awx_token_name: "{{ awx_token_name }}" organization_name: Default + swap_single_source: False event_streams: - event_stream: "{{ event_stream_name }}" source_name: "{{ _result_rulebook_info.rulebooks[0].sources[0].name }}" @@ -404,6 +411,11 @@ that: - event_stream_name in (source_mappings_dict | map(attribute='event_stream_name') | list) + - name: Assert that swap single source flag is disabled + ansible.builtin.assert: + that: + - not _result_activation_info.activations[0].swap_single_source + - name: Delete project ansible.eda.project: name: "{{ project_name }}"