proxmox: disable password SSH authentication

Apparently it’s not needed for cluster operations.
This commit is contained in:
Timotej Lazar 2024-12-13 14:49:44 +01:00
parent c585070edc
commit e5b570ddad
2 changed files with 18 additions and 0 deletions

View file

@ -12,6 +12,12 @@
state: reloaded
when: "'handler' not in ansible_skip_tags"
- name: reload sshd
service:
name: sshd
state: reloaded
when: "'handler' not in ansible_skip_tags"
- name: update package cache
package:
update_cache: yes

View file

@ -18,6 +18,18 @@
src: resolv.conf.j2
mode: 0644
- name: Disable SSH password authentication
lineinfile:
path: /etc/ssh/sshd_config
regexp: '^#?{{ item.key }}'
line: '{{ item.key }} {{ item.value }}'
loop:
- key: PasswordAuthentication
value: 'no'
- key: PermitRootLogin
value: 'prohibit-password'
notify: reload sshd
- include_tasks: network.yml
- name: Disable enterprise repositories