From f5ac537f5cc83bac57aa59ce3260825707728593 Mon Sep 17 00:00:00 2001 From: Matt Willsher Date: Fri, 21 Jun 2024 08:22:11 +0100 Subject: [PATCH] fix: variables not present in tests, id os from facts --- tests/tests_second_service.yml | 3 ++- tests/tests_second_service_drop_in.yml | 3 ++- tests/tests_systemd_services.yml | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/tests_second_service.yml b/tests/tests_second_service.yml index 921bc2a..0dcc0fb 100644 --- a/tests/tests_second_service.yml +++ b/tests/tests_second_service.yml @@ -99,7 +99,8 @@ src: "/etc/systemd/system/sshd2@.service" register: service_inst when: - - __sshd_socket_accept | bool + - ansible_facts['distribution'] != "Debian" or ansible_facts['distribution_major_version'] | int < 12 + - not (ansible_facts['distribution'] == 'Ubuntu' and ansible_facts['distribution_version'] is version('24.04', '>=')) - name: Check content of the created service file ansible.builtin.assert: diff --git a/tests/tests_second_service_drop_in.yml b/tests/tests_second_service_drop_in.yml index 22e4a71..c8d9596 100644 --- a/tests/tests_second_service_drop_in.yml +++ b/tests/tests_second_service_drop_in.yml @@ -111,7 +111,8 @@ src: "/etc/systemd/system/sshd2@.service" register: service_inst when: - - __sshd_socket_accept | bool + - ansible_facts['distribution'] != "Debian" or ansible_facts['distribution_major_version'] | int < 12 + - not (ansible_facts['distribution'] == 'Ubuntu' and ansible_facts['distribution_version'] is version('24.04', '>=')) - name: Check content of the created service file ansible.builtin.assert: diff --git a/tests/tests_systemd_services.yml b/tests/tests_systemd_services.yml index e1679a7..e37c45c 100644 --- a/tests/tests_systemd_services.yml +++ b/tests/tests_systemd_services.yml @@ -117,7 +117,8 @@ when: - ansible_facts['service_mgr'] == 'systemd' or (ansible_facts['os_family'] == 'RedHat' and ansible_facts['distribution_major_version'] == '7') - - __sshd_socket_accept | bool + - ansible_facts['distribution'] != "Debian" or ansible_facts['distribution_major_version'] | int < 12 + - not (ansible_facts['distribution'] == 'Ubuntu' and ansible_facts['distribution_version'] is version('24.04', '>=')) block: - name: Read the distribution instantiated service file ansible.builtin.slurp: