We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 63f8935 commit cc0587aCopy full SHA for cc0587a
controls/roles/2fa-remove/tasks/main.yaml
@@ -36,7 +36,15 @@
36
state: absent
37
ignore_errors: yes
38
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
+
47
- name: Restart SSH service
48
systemd:
- name: sshd
49
+ name: "{{ ssh_service_name }}"
50
state: restarted
0 commit comments