Skip to content

Commit

Permalink
fix(tests): Ubuntu 24.04 ssh service has no at in the name
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwillsher committed Jun 7, 2024
1 parent 97ff913 commit da558f1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tests/tests_systemd_services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
- /etc/systemd/system/ssh@.service
- /etc/systemd/system/ssh.socket
__sshd_test_service_name: sshd
__sshd_test_service_name_at: '@'
__sshd_service_list: []
__sshd_service_inst_list: []
__sshd_socket_list: []
Expand All @@ -22,6 +23,12 @@
when:
- ansible_facts['os_family'] == "Debian"

- name: No at in the service on Ubuntu 24.04
ansible.builtin.set_fact:
__sshd_test_service_name_at: ''
when:
- ansible_facts['distribution']=='Ubuntu' and ansible_facts['distribution_version'] is version('24.04', '>=')

- name: Backup configuration files
ansible.builtin.include_tasks: tasks/backup.yml

Expand Down Expand Up @@ -123,7 +130,7 @@
block:
- name: Read the distribution instantiated service file
ansible.builtin.slurp:
src: "/lib/systemd/system/{{ __sshd_test_service_name }}@.service"
src: "/lib/systemd/system/{{ __sshd_test_service_name }}{{ __sshd_test_service_name_at }}.service"
register: service_inst_old

- name: Read the created instantiated service file
Expand Down

0 comments on commit da558f1

Please sign in to comment.