ssh: Ensure ssh enabled, use ssh.service unit on debian
This commit is contained in:
@@ -6,8 +6,13 @@
|
||||
line: "{{ item.key }} {{ item.value }}"
|
||||
state: present
|
||||
validate: '/usr/sbin/sshd -t -f %s'
|
||||
notify: Restart sshd
|
||||
notify: Restart ssh service
|
||||
with_dict:
|
||||
PermitRootLogin: "prohibit-password"
|
||||
PasswordAuthentication: "{{ 'yes' if ssh_password_auth else 'no' }}"
|
||||
X11Forwarding: "no"
|
||||
|
||||
- name: Ensure ssh service is enabled
|
||||
ansible.builtin.systemd_service:
|
||||
name: "{{ _ssh_service_name }}"
|
||||
enabled: true
|
||||
|
||||
Reference in New Issue
Block a user