diff --git a/tests/setup-snapshot.yml b/tests/setup-snapshot.yml index 9a10eb95..ed7aaf6b 100644 --- a/tests/setup-snapshot.yml +++ b/tests/setup-snapshot.yml @@ -7,10 +7,9 @@ __snapshot_gather_vars: true tasks: - name: Set platform/version specific variables - include_role: - name: linux-system-roles.logging - public: true - + include_tasks: tasks/run_role_with_clear_facts.yml + vars: + __sr_public: true - name: Install test packages package: # not really invalid - see https://github.com/ansible/ansible-lint/issues/4702 diff --git a/tests/tasks/run_role_with_clear_facts.yml b/tests/tasks/run_role_with_clear_facts.yml new file mode 100644 index 00000000..013d60e0 --- /dev/null +++ b/tests/tasks/run_role_with_clear_facts.yml @@ -0,0 +1,37 @@ +--- +# Task file: clear_facts, run linux-system-roles.logging. +# Include this with include_tasks or import_tasks +# Input: +# - __sr_tasks_from: tasks_from to run - same as tasks_from in include_role +# - __sr_public: export private vars from role - same as public in include_role +# - __sr_failed_when: set to false to ignore role errors - same as failed_when in include_role +- name: Clear facts + meta: clear_facts + +# note that you can use failed_when with import_role but not with include_role +# so this simulates the __sr_failed_when false case +# Q: Why do we need a separate task to run the role normally? Why not just +# run the role in the block and rethrow the error in the rescue block? +# A: Because you cannot rethrow the error in exactly the same way as the role does. +# It might be possible to exactly reconstruct ansible_failed_result but it's not worth the effort. +- name: Run the role with __sr_failed_when false + when: + - __sr_failed_when is defined + - not __sr_failed_when + block: + - name: Run the role + include_role: + name: linux-system-roles.logging + tasks_from: "{{ __sr_tasks_from | default('main') }}" + public: "{{ __sr_public | default(false) }}" + rescue: + - name: Ignore the failure when __sr_failed_when is false + debug: + msg: Ignoring failure when __sr_failed_when is false + +- name: Run the role normally + include_role: + name: linux-system-roles.logging + tasks_from: "{{ __sr_tasks_from | default('main') }}" + public: "{{ __sr_public | default(false) }}" + when: __sr_failed_when | d(true) diff --git a/tests/tests_basics_files.yml b/tests/tests_basics_files.yml index aa2adbf9..33b10262 100644 --- a/tests/tests_basics_files.yml +++ b/tests/tests_basics_files.yml @@ -36,12 +36,8 @@ logging_inputs: - name: basic_input type: basics - include_role: - name: linux-system-roles.logging - public: true - - # notify Restart rsyslogd is executed at the end of this test task. - # thus we have to force to invoke handlers + __sr_public: true + include_tasks: tasks/run_role_with_clear_facts.yml - name: "Force all notified handlers to run at this point, not waiting for normal sync points" meta: flush_handlers @@ -92,10 +88,8 @@ logging_inputs: [] logging_outputs: [] logging_flows: [] - include_role: - name: linux-system-roles.logging - public: true - + __sr_public: true + include_tasks: tasks/run_role_with_clear_facts.yml - name: Check ports managed by firewall and selinux - 2 include_tasks: tasks/check_firewall_selinux.yml @@ -125,12 +119,8 @@ - name: flows0 inputs: [basic_input] outputs: [files_output0] - include_role: - name: linux-system-roles.logging - public: true - - # notify Restart rsyslogd is executed at the end of this test task. - # thus we have to force to invoke handlers + __sr_public: true + include_tasks: tasks/run_role_with_clear_facts.yml - name: "Force all notified handlers to run at this point, not waiting for normal sync points - 3" meta: flush_handlers @@ -178,10 +168,8 @@ logging_inputs: [] logging_outputs: [] logging_flows: [] - include_role: - name: linux-system-roles.logging - public: true - + __sr_public: true + include_tasks: tasks/run_role_with_clear_facts.yml - name: Check ports managed by firewall and selinux - 4 include_tasks: tasks/check_firewall_selinux.yml @@ -235,9 +223,7 @@ - files_output1 - files_output2 - files_output3 - include_role: - name: linux-system-roles.logging - + include_tasks: tasks/run_role_with_clear_facts.yml - name: Unreachable task fail: msg: UNREACH @@ -256,11 +242,7 @@ logging_inputs: [] logging_outputs: [] logging_flows: [] - include_role: - name: linux-system-roles.logging - - # notify Restart rsyslogd is executed at the end of this test task. - # thus we have to force to invoke handlers + include_tasks: tasks/run_role_with_clear_facts.yml - name: "Force all notified handlers to run at this point, not waiting for normal sync points - 5" meta: flush_handlers @@ -322,12 +304,8 @@ property(name="timestamp" dateFormat="rfc3339") constant(value=" ThisIsBasicTestFormat\n") } - include_role: - name: linux-system-roles.logging - public: true - - # notify Restart rsyslogd is executed at the end of this test task. - # thus we have to force to invoke handlers + __sr_public: true + include_tasks: tasks/run_role_with_clear_facts.yml - name: "Force all notified handlers to run at this point, not waiting for normal sync points - 6" meta: flush_handlers @@ -407,10 +385,8 @@ logging_inputs: [] logging_outputs: [] logging_flows: [] - include_role: - name: linux-system-roles.logging - public: true - + __sr_public: true + include_tasks: tasks/run_role_with_clear_facts.yml - name: Check ports managed by firewall and selinux - 6 include_tasks: tasks/check_firewall_selinux.yml diff --git a/tests/tests_basics_forwards.yml b/tests/tests_basics_forwards.yml index e130a331..feb8ae51 100644 --- a/tests/tests_basics_forwards.yml +++ b/tests/tests_basics_forwards.yml @@ -113,12 +113,8 @@ - forwards_no_severity_and_facility_protocol_port - forwards_no_severity_and_facility_protocol_port_target - default_files - include_role: - name: linux-system-roles.logging - public: true - - # notify Restart rsyslogd is executed at the end of this test task. - # thus we have to force to invoke handlers + __sr_public: true + include_tasks: tasks/run_role_with_clear_facts.yml - name: "Force all notified handlers to run at this point, not waiting for normal sync points" meta: flush_handlers @@ -299,11 +295,7 @@ logging_inputs: [] logging_outputs: [] logging_flows: [] - include_role: - name: linux-system-roles.logging - - # notify Restart rsyslogd is executed at the end of this test task. - # thus we have to force to invoke handlers + include_tasks: tasks/run_role_with_clear_facts.yml - name: "Force all notified handlers to run at this point, not waiting for normal sync points" meta: flush_handlers @@ -343,11 +335,7 @@ - name: flows0 inputs: [basic_input] outputs: [forwards_severity_and_facility] - include_role: - name: linux-system-roles.logging - - # notify Restart rsyslogd is executed at the end of this test task. - # thus we have to force to invoke handlers + include_tasks: tasks/run_role_with_clear_facts.yml - name: "Force all notified handlers to run at this point, not waiting for normal sync points" meta: flush_handlers @@ -403,11 +391,7 @@ logging_inputs: [] logging_outputs: [] logging_flows: [] - include_role: - name: linux-system-roles.logging - - # notify Restart rsyslogd is executed at the end of this test task. - # thus we have to force to invoke handlers + include_tasks: tasks/run_role_with_clear_facts.yml - name: "Force all notified handlers to run at this point, not waiting for normal sync points" meta: flush_handlers @@ -457,11 +441,7 @@ - name: flows0 inputs: [basic_input] outputs: [forwards_severity_and_facility] - include_role: - name: linux-system-roles.logging - - # notify Restart rsyslogd is executed at the end of this test task. - # thus we have to force to invoke handlers + include_tasks: tasks/run_role_with_clear_facts.yml - name: "Force all notified handlers to run at this point, not waiting for normal sync points" meta: flush_handlers @@ -523,11 +503,7 @@ logging_inputs: [] logging_outputs: [] logging_flows: [] - include_role: - name: linux-system-roles.logging - - # notify Restart rsyslogd is executed at the end of this test task. - # thus we have to force to invoke handlers + include_tasks: tasks/run_role_with_clear_facts.yml - name: "Force all notified handlers to run at this point, not waiting for normal sync points" meta: flush_handlers @@ -577,9 +553,7 @@ - name: flows0 inputs: [basic_input] outputs: [forwards_severity_and_facility] - include_role: - name: linux-system-roles.logging - + include_tasks: tasks/run_role_with_clear_facts.yml - name: Unreachable task fail: msg: UNREACH @@ -599,11 +573,7 @@ logging_inputs: [] logging_outputs: [] logging_flows: [] - include_role: - name: linux-system-roles.logging - - # notify Restart rsyslogd is executed at the end of this test task. - # thus we have to force to invoke handlers + include_tasks: tasks/run_role_with_clear_facts.yml - name: "Force all notified handlers to run at this point, not waiting for normal sync points" meta: flush_handlers diff --git a/tests/tests_cert_container.yml b/tests/tests_cert_container.yml index 043588a2..21908d4c 100644 --- a/tests/tests_cert_container.yml +++ b/tests/tests_cert_container.yml @@ -16,9 +16,7 @@ - name: logging_cert dns: ['localhost', 'www.example.com'] ca: self-sign - include_role: - name: linux-system-roles.logging - + include_tasks: tasks/run_role_with_clear_facts.yml - name: Unreachable task fail: msg: UNREACH diff --git a/tests/tests_combination.yml b/tests/tests_combination.yml index 55c40c45..2bc7b29c 100644 --- a/tests/tests_combination.yml +++ b/tests/tests_combination.yml @@ -2,7 +2,6 @@ - name: "Combination test - test for (2 types of inputs) x (2 types of outputs) combination" hosts: all - gather_facts: true # test needs facts vars: __test_files_conf: /etc/rsyslog.d/30-output-files-files_test0.conf __test_forwards_conf_s_f: >- @@ -12,7 +11,8 @@ __test_basics_conf: /etc/rsyslog.d/90-input-basics-basic_input.conf __test_inputfiles_dir: /var/log/inputdirectory __default_system_log: /var/log/messages - + vars_files: + - vars/rh_distros_vars.yml tasks: - name: Generate an input log dir {{ __test_inputfiles_dir }} file: @@ -20,6 +20,11 @@ state: directory mode: "0700" + - name: Set fact for is_el7 + set_fact: + is_el7: "{{ __logging_is_rh_distro and + ansible_facts['distribution_major_version'] is version('7', '==') }}" + # TEST CASE 0 - name: "TEST CASE 0; Ensure that the role runs with complicated flows - M x N combinations" @@ -54,10 +59,7 @@ type: files input_log_path: "{{ __test_inputfiles_dir }}/*.log" # Not supported on EL 7 - endmsg_regex: "{{ omit - if ansible_facts['distribution'] in ['CentOS', 'RedHat'] and - ansible_facts['distribution_major_version'] is version('7', '==') - else 'xyz' }}" + endmsg_regex: "{{ omit if is_el7 else 'xyz' }}" - name: basic_input type: basics ratelimit_burst: 33333 @@ -75,9 +77,8 @@ - name: flow_1 inputs: ["{{ __test_tag }}"] outputs: [files_test0, files_test1] - include_role: - name: linux-system-roles.logging - public: true + __sr_public: true + include_tasks: tasks/run_role_with_clear_facts.yml when: not __bootc_validation | d(false) # role does not run during bootc QEMU validation, thus some variables are undefined @@ -221,11 +222,8 @@ logging_inputs: [] logging_outputs: [] logging_flows: [] - include_role: - name: linux-system-roles.logging - public: true - - # do just one image/verify cycle for the bootc end-to-end test + __sr_public: true + include_tasks: tasks/run_role_with_clear_facts.yml - name: Skip remaining steps in bootc end-to-end validation meta: end_play when: __bootc_validation | d(false) @@ -288,12 +286,8 @@ - name: flow_3 inputs: [basic_input] outputs: [forwards_facility_only] - include_role: - name: linux-system-roles.logging - public: true - - # notify Restart rsyslogd is executed at the end of this test task. - # thus we have to force to invoke handlers + __sr_public: true + include_tasks: tasks/run_role_with_clear_facts.yml - name: "Force all notified handlers to run at this point, not waiting for normal sync points - 3" meta: flush_handlers @@ -402,12 +396,8 @@ logging_inputs: [] logging_outputs: [] logging_flows: [] - include_role: - name: linux-system-roles.logging - public: true - - # notify Restart rsyslogd is executed at the end of this test task. - # thus we have to force to invoke handlers + __sr_public: true + include_tasks: tasks/run_role_with_clear_facts.yml - name: "Force all notified handlers to run at this point, not waiting for normal sync points - 4" meta: flush_handlers @@ -462,12 +452,8 @@ - name: flow_1 inputs: ["{{ __test_tag }}"] outputs: [files_test0, files_test1] - include_role: - name: linux-system-roles.logging - public: true - - # notify Restart rsyslogd is executed at the end of this test task. - # thus we have to force to invoke handlers + __sr_public: true + include_tasks: tasks/run_role_with_clear_facts.yml - name: "Force all notified handlers to run at this point, not waiting for normal sync points - 5" meta: flush_handlers @@ -549,12 +535,8 @@ - name: flow_0 inputs: [basic_input] outputs: [files_test0] - include_role: - name: linux-system-roles.logging - public: true - - # notify Restart rsyslogd is executed at the end of this test task. - # thus we have to force to invoke handlers + __sr_public: true + include_tasks: tasks/run_role_with_clear_facts.yml - name: "Force all notified handlers to run at this point, not waiting for normal sync points - 7" meta: flush_handlers @@ -593,10 +575,8 @@ logging_inputs: [] logging_outputs: [] logging_flows: [] - include_role: - name: linux-system-roles.logging - public: true - + __sr_public: true + include_tasks: tasks/run_role_with_clear_facts.yml - name: Cleaning up __testfile__ file: path: "/tmp/__testfile__" diff --git a/tests/tests_default.yml b/tests/tests_default.yml index 525ed402..a8dfdb1f 100644 --- a/tests/tests_default.yml +++ b/tests/tests_default.yml @@ -3,9 +3,7 @@ # - name: Ensure that the role runs with default parameters hosts: all - gather_facts: false tasks: - name: Default run (NOOP) - include_role: - name: linux-system-roles.logging + include_tasks: tasks/run_role_with_clear_facts.yml diff --git a/tests/tests_enabled.yml b/tests/tests_enabled.yml index 3302b25a..902610fa 100644 --- a/tests/tests_enabled.yml +++ b/tests/tests_enabled.yml @@ -36,11 +36,7 @@ - name: Default run vars: logging_purge_confs: true - include_role: - name: linux-system-roles.logging - - # notify Restart rsyslogd is executed at the end of this test task. - # thus we have to force to invoke handlers + include_tasks: tasks/run_role_with_clear_facts.yml - name: "Force all notified handlers to run at this point, not waiting for normal sync points" meta: flush_handlers diff --git a/tests/tests_files_elasticsearch.yml b/tests/tests_files_elasticsearch.yml index d268dd3d..5665689a 100644 --- a/tests/tests_files_elasticsearch.yml +++ b/tests/tests_files_elasticsearch.yml @@ -80,12 +80,8 @@ - name: flow_0 inputs: [files_input] outputs: "{{ [__test_el] }}" - include_role: - name: linux-system-roles.logging - public: true - - # notify Restart rsyslogd is executed at the end of this test task. - # thus we have to force to invoke handlers + __sr_public: true + include_tasks: tasks/run_role_with_clear_facts.yml - name: "Force all notified handlers to run at this point, not waiting for normal sync points" meta: flush_handlers @@ -148,11 +144,7 @@ logging_inputs: [] logging_outputs: [] logging_flows: [] - include_role: - name: linux-system-roles.logging - - # notify Restart rsyslogd is executed at the end of this test task. - # thus we have to force to invoke handlers + include_tasks: tasks/run_role_with_clear_facts.yml - name: "Force all notified handlers to run at this point, not waiting for normal sync points" meta: flush_handlers @@ -192,11 +184,7 @@ - name: flow_0 inputs: [files_input] outputs: [elasticsearch_output] - include_role: - name: linux-system-roles.logging - - # notify Restart rsyslogd is executed at the end of this test task. - # thus we have to force to invoke handlers + include_tasks: tasks/run_role_with_clear_facts.yml - name: "Force all notified handlers to run at this point, not waiting for normal sync points" meta: flush_handlers @@ -239,11 +227,7 @@ logging_inputs: [] logging_outputs: [] logging_flows: [] - include_role: - name: linux-system-roles.logging - - # notify Restart rsyslogd is executed at the end of this test task. - # thus we have to force to invoke handlers + include_tasks: tasks/run_role_with_clear_facts.yml - name: "Force all notified handlers to run at this point, not waiting for normal sync points" meta: flush_handlers @@ -281,11 +265,7 @@ - name: flow_0 inputs: [files_input] outputs: [elasticsearch_output] - include_role: - name: linux-system-roles.logging - - # notify Restart rsyslogd is executed at the end of this test task. - # thus we have to force to invoke handlers + include_tasks: tasks/run_role_with_clear_facts.yml - name: "Force all notified handlers to run at this point, not waiting for normal sync points" meta: flush_handlers @@ -332,11 +312,7 @@ logging_inputs: [] logging_outputs: [] logging_flows: [] - include_role: - name: linux-system-roles.logging - - # notify Restart rsyslogd is executed at the end of this test task. - # thus we have to force to invoke handlers + include_tasks: tasks/run_role_with_clear_facts.yml - name: "Force all notified handlers to run at this point, not waiting for normal sync points" meta: flush_handlers @@ -367,9 +343,7 @@ - name: flow_0 inputs: [files_input] outputs: [elasticsearch_output, elasticsearch_output_ops] - include_role: - name: linux-system-roles.logging - + include_tasks: tasks/run_role_with_clear_facts.yml - name: Unreachable task fail: msg: UNREACH @@ -388,11 +362,7 @@ logging_inputs: [] logging_outputs: [] logging_flows: [] - include_role: - name: linux-system-roles.logging - - # notify Restart rsyslogd is executed at the end of this test task. - # thus we have to force to invoke handlers + include_tasks: tasks/run_role_with_clear_facts.yml - name: "Force all notified handlers to run at this point, not waiting for normal sync points" meta: flush_handlers @@ -428,9 +398,7 @@ - name: flow_0 inputs: [files_input] outputs: [elasticsearch_output, elasticsearch_output_ops] - include_role: - name: linux-system-roles.logging - + include_tasks: tasks/run_role_with_clear_facts.yml - name: Unreachable task fail: msg: UNREACH @@ -449,11 +417,7 @@ logging_inputs: [] logging_outputs: [] logging_flows: [] - include_role: - name: linux-system-roles.logging - - # notify Restart rsyslogd is executed at the end of this test task. - # thus we have to force to invoke handlers + include_tasks: tasks/run_role_with_clear_facts.yml - name: "Force all notified handlers to run at this point, not waiting for normal sync points" meta: flush_handlers diff --git a/tests/tests_files_files.yml b/tests/tests_files_files.yml index e4374604..8028c561 100644 --- a/tests/tests_files_files.yml +++ b/tests/tests_files_files.yml @@ -95,12 +95,8 @@ - name: flow_0 inputs: [files_input0, "php:"] outputs: [files_output0, files_output1] - include_role: - name: linux-system-roles.logging - public: true - - # notify Restart rsyslogd is executed at the end of this test task. - # thus we have to force to invoke handlers + __sr_public: true + include_tasks: tasks/run_role_with_clear_facts.yml - name: "Force all notified handlers to run at this point, not waiting for normal sync points" meta: flush_handlers @@ -201,10 +197,8 @@ logging_inputs: [] logging_outputs: [] logging_flows: [] - include_role: - name: linux-system-roles.logging - public: true - + __sr_public: true + include_tasks: tasks/run_role_with_clear_facts.yml - name: Remove tempdir file: path: "{{ __logging_tmpdir.path }}" diff --git a/tests/tests_imuxsock_files.yml b/tests/tests_imuxsock_files.yml index b8639eb3..58da7c2a 100644 --- a/tests/tests_imuxsock_files.yml +++ b/tests/tests_imuxsock_files.yml @@ -42,12 +42,8 @@ - name: basic_input type: basics use_imuxsock: true - include_role: - name: linux-system-roles.logging - public: true - - # notify Restart rsyslogd is executed at the end of this test task. - # thus we have to force to invoke handlers + __sr_public: true + include_tasks: tasks/run_role_with_clear_facts.yml - name: "Force all notified handlers to run at this point, not waiting for normal sync points" meta: flush_handlers @@ -86,12 +82,8 @@ logging_inputs: [] logging_outputs: [] logging_flows: [] - include_role: - name: linux-system-roles.logging - public: true - - # notify Restart rsyslogd is executed at the end of this test task. - # thus we have to force to invoke handlers + __sr_public: true + include_tasks: tasks/run_role_with_clear_facts.yml - name: "Force all notified handlers to run at this point, not waiting for normal sync points - 2" meta: flush_handlers diff --git a/tests/tests_include_vars_from_parent.yml b/tests/tests_include_vars_from_parent.yml index 5408cd4d..f0783aed 100644 --- a/tests/tests_include_vars_from_parent.yml +++ b/tests/tests_include_vars_from_parent.yml @@ -1,7 +1,6 @@ --- - name: Test role include variable override hosts: all - gather_facts: true tasks: - name: Create var file in caller that can override the one in called role delegate_to: localhost diff --git a/tests/tests_ovirt_elasticsearch.yml b/tests/tests_ovirt_elasticsearch.yml index 0439d77e..785bd1e6 100644 --- a/tests/tests_ovirt_elasticsearch.yml +++ b/tests/tests_ovirt_elasticsearch.yml @@ -78,11 +78,7 @@ - name: flow_1 inputs: [basic_input] outputs: [default_files] - include_role: - name: linux-system-roles.logging - - # notify Restart rsyslogd is executed at the end of this test task. - # thus we have to force to invoke handlers + include_tasks: tasks/run_role_with_clear_facts.yml - name: "Force all notified handlers to run at this point, not waiting for normal sync points" meta: flush_handlers @@ -174,11 +170,7 @@ logging_inputs: [] logging_outputs: [] logging_flows: [] - include_role: - name: linux-system-roles.logging - - # notify Restart rsyslogd is executed at the end of this test task. - # thus we have to force to invoke handlers + include_tasks: tasks/run_role_with_clear_facts.yml - name: "Force all notified handlers to run at this point, not waiting for normal sync points - 2" meta: flush_handlers @@ -256,11 +248,7 @@ - name: flow_1 inputs: [basic_input] outputs: [default_files] - include_role: - name: linux-system-roles.logging - - # notify Restart rsyslogd is executed at the end of this test task. - # thus we have to force to invoke handlers + include_tasks: tasks/run_role_with_clear_facts.yml - name: "Force all notified handlers to run at this point, not waiting for normal sync points - 3" meta: flush_handlers @@ -368,11 +356,7 @@ logging_inputs: [] logging_outputs: [] logging_flows: [] - include_role: - name: linux-system-roles.logging - - # notify Restart rsyslogd is executed at the end of this test task. - # thus we have to force to invoke handlers + include_tasks: tasks/run_role_with_clear_facts.yml - name: "Force all notified handlers to run at this point, not waiting for normal sync points - 4" meta: flush_handlers diff --git a/tests/tests_purge_reset.yml b/tests/tests_purge_reset.yml index fc49eebf..578f4485 100644 --- a/tests/tests_purge_reset.yml +++ b/tests/tests_purge_reset.yml @@ -49,12 +49,8 @@ logging_inputs: - name: basic_input type: basics - include_role: - name: linux-system-roles.logging - public: true - - # notify Restart rsyslogd is executed at the end of this test task. - # thus we have to force to invoke handlers + __sr_public: true + include_tasks: tasks/run_role_with_clear_facts.yml - name: "Force all notified handlers to run at this point, not waiting for normal sync points" meta: flush_handlers @@ -90,10 +86,8 @@ logging_inputs: - name: basic_input type: basics - include_role: - name: linux-system-roles.logging - public: true - + __sr_public: true + include_tasks: tasks/run_role_with_clear_facts.yml - name: Check11 rsyslog config files command: ls /etc/rsyslog.d changed_when: false @@ -108,10 +102,8 @@ logging_inputs: [] logging_outputs: [] logging_flows: [] - include_role: - name: linux-system-roles.logging - public: true - + __sr_public: true + include_tasks: tasks/run_role_with_clear_facts.yml - name: Ensure config file size and counts - 2 vars: __conf_count: 0 @@ -142,10 +134,8 @@ logging_inputs: [] logging_outputs: [] logging_flows: [] - include_role: - name: linux-system-roles.logging - public: true - + __sr_public: true + include_tasks: tasks/run_role_with_clear_facts.yml - name: Check3 rsyslog config files command: ls /etc/rsyslog.d changed_when: false diff --git a/tests/tests_relp.yml b/tests/tests_relp.yml index 250e42a0..eb261bb9 100644 --- a/tests/tests_relp.yml +++ b/tests/tests_relp.yml @@ -65,12 +65,8 @@ - name: flows inputs: [system_input, relp_server0, relp_server1] outputs: [files_output, forwards_output] - include_role: - name: linux-system-roles.logging - public: true - - # notify Restart rsyslogd is executed at the end of this test task. - # thus we have to force to invoke handlers + __sr_public: true + include_tasks: tasks/run_role_with_clear_facts.yml - name: "Force all notified handlers to run at this point, not waiting for normal sync points" meta: flush_handlers @@ -213,12 +209,8 @@ logging_inputs: [] logging_outputs: [] logging_flows: [] - include_role: - name: linux-system-roles.logging - public: true - - # notify Restart rsyslogd is executed at the end of this test task. - # thus we have to force to invoke handlers + __sr_public: true + include_tasks: tasks/run_role_with_clear_facts.yml - name: "Force all notified handlers to run at this point, not waiting for normal sync points - 2" meta: flush_handlers @@ -270,12 +262,8 @@ - name: flows inputs: [system_input] outputs: [relp_client0, relp_client1] - include_role: - name: linux-system-roles.logging - public: true - - # notify Restart rsyslogd is executed at the end of this test task. - # thus we have to force to invoke handlers + __sr_public: true + include_tasks: tasks/run_role_with_clear_facts.yml - name: "Force all notified handlers to run at this point, not waiting for normal sync points - 3" meta: flush_handlers @@ -367,12 +355,8 @@ logging_inputs: [] logging_outputs: [] logging_flows: [] - include_role: - name: linux-system-roles.logging - public: true - - # notify Restart rsyslogd is executed at the end of this test task. - # thus we have to force to invoke handlers + __sr_public: true + include_tasks: tasks/run_role_with_clear_facts.yml - name: "Force all notified handlers to run at this point, not waiting for normal sync points - 4" meta: flush_handlers diff --git a/tests/tests_remote.yml b/tests/tests_remote.yml index fb9ef7e0..bcfdfbb3 100644 --- a/tests/tests_remote.yml +++ b/tests/tests_remote.yml @@ -31,12 +31,8 @@ - name: flow_0 inputs: [remote_udp_input, remote_tcp_input] outputs: [remote_files_output0] - include_role: - name: linux-system-roles.logging - public: true - - # notify Restart rsyslogd is executed at the end of this test task. - # thus we have to force to invoke handlers + __sr_public: true + include_tasks: tasks/run_role_with_clear_facts.yml - name: "Force all notified handlers to run at this point, not waiting for normal sync points" meta: flush_handlers @@ -110,12 +106,8 @@ logging_inputs: [] logging_outputs: [] logging_flows: [] - include_role: - name: linux-system-roles.logging - public: true - - # notify Restart rsyslogd is executed at the end of this test task. - # thus we have to force to invoke handlers + __sr_public: true + include_tasks: tasks/run_role_with_clear_facts.yml - name: "Force all notified handlers to run at this point, not waiting for normal sync points - 2" meta: flush_handlers @@ -163,12 +155,8 @@ - name: flow_0 inputs: [remote_udp_input, remote_tcp_input] outputs: [remote_files_output0, remote_files_output1] - include_role: - name: linux-system-roles.logging - public: true - - # notify Restart rsyslogd is executed at the end of this test task. - # thus we have to force to invoke handlers + __sr_public: true + include_tasks: tasks/run_role_with_clear_facts.yml - name: "Force all notified handlers to run at this point, not waiting for normal sync points - 3" meta: flush_handlers @@ -241,12 +229,8 @@ logging_inputs: [] logging_outputs: [] logging_flows: [] - include_role: - name: linux-system-roles.logging - public: true - - # notify Restart rsyslogd is executed at the end of this test task. - # thus we have to force to invoke handlers + __sr_public: true + include_tasks: tasks/run_role_with_clear_facts.yml - name: "Force all notified handlers to run at this point, not waiting for normal sync points - 6" meta: flush_handlers diff --git a/tests/tests_server.yml b/tests/tests_server.yml index d25e0da7..fb21389d 100644 --- a/tests/tests_server.yml +++ b/tests/tests_server.yml @@ -63,12 +63,8 @@ - name: flows inputs: [system_input, remote_tcp, remote_ptcp, remote_udp] outputs: [files_output] - include_role: - name: linux-system-roles.logging - public: true - - # notify Restart rsyslogd is executed at the end of this test task. - # thus we have to force to invoke handlers + __sr_public: true + include_tasks: tasks/run_role_with_clear_facts.yml - name: "Force all notified handlers to run at this point, not waiting for normal sync points" meta: flush_handlers @@ -125,12 +121,8 @@ logging_inputs: [] logging_outputs: [] logging_flows: [] - include_role: - name: linux-system-roles.logging - public: true - - # notify Restart rsyslogd is executed at the end of this test task. - # thus we have to force to invoke handlers + __sr_public: true + include_tasks: tasks/run_role_with_clear_facts.yml - name: "Force all notified handlers to run at this point, not waiting for normal sync points - 2" meta: flush_handlers @@ -181,9 +173,7 @@ - name: flows inputs: [system_input, remote_tcp_0, remote_tcp_1, remote_udp] outputs: [files_output] - include_role: - name: linux-system-roles.logging - + include_tasks: tasks/run_role_with_clear_facts.yml - name: Unreachable task fail: msg: UNREACH @@ -206,9 +196,7 @@ logging_inputs: [] logging_outputs: [] logging_flows: [] - include_role: - name: linux-system-roles.logging - + include_tasks: tasks/run_role_with_clear_facts.yml rescue: - name: Check error debug: diff --git a/tests/tests_version.yml b/tests/tests_version.yml index 6a90e519..f93cc6d9 100644 --- a/tests/tests_version.yml +++ b/tests/tests_version.yml @@ -14,9 +14,7 @@ tasks: - name: Default run - include_role: - name: linux-system-roles.logging - + include_tasks: tasks/run_role_with_clear_facts.yml - name: Check rsyslog version assert: that: __rsyslog_version != "0.0.0"