Skip to content

Commit

Permalink
fix: variables not present in tests, id os from facts
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwillsher committed Jun 21, 2024
1 parent 3af1491 commit f5ac537
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion tests/tests_second_service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion tests/tests_second_service_drop_in.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion tests/tests_systemd_services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit f5ac537

Please sign in to comment.