Skip to content

Commit cc0587a

Browse files
authored
FIX: 2FA remove issue on ubuntu-24.04 (#2247)
1 parent 63f8935 commit cc0587a

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

controls/roles/2fa-remove/tasks/main.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,15 @@
3636
state: absent
3737
ignore_errors: yes
3838

39+
- name: Set SSH service name depending on distribution and version
40+
set_fact:
41+
ssh_service_name: >-
42+
{{ 'ssh'
43+
if (ansible_facts['distribution'] == 'Ubuntu'
44+
and ansible_facts['distribution_version'] is version('20.04', '>='))
45+
else 'sshd' }}
46+
3947
- name: Restart SSH service
4048
systemd:
41-
name: sshd
49+
name: "{{ ssh_service_name }}"
4250
state: restarted

0 commit comments

Comments
 (0)