ssh: use sshd instead of ssh to make it work on fedora

This commit is contained in:
uumas
2025-01-27 04:55:32 +02:00
parent d94cc30aa5
commit e2f5e49fe8
2 changed files with 4 additions and 5 deletions

View File

@@ -1,6 +1,5 @@
--- ---
- name: Restart sshd
- name: Restart ssh ansible.builtin.systemd_service:
ansible.builtin.systemd: name: sshd.service
name: ssh
state: restarted state: restarted

View File

@@ -6,7 +6,7 @@
line: "{{ item.key }} {{ item.value }}" line: "{{ item.key }} {{ item.value }}"
state: present state: present
validate: '/usr/sbin/sshd -t -f %s' validate: '/usr/sbin/sshd -t -f %s'
notify: Restart ssh notify: Restart sshd
with_dict: with_dict:
PermitRootLogin: 'prohibit-password' PermitRootLogin: 'prohibit-password'
PasswordAuthentication: "{{ 'yes' if sshd_password_auth else 'no' }}" PasswordAuthentication: "{{ 'yes' if sshd_password_auth else 'no' }}"