Sync from polyfloyd infra

This commit is contained in:
polyfloyd 2024-06-24 20:25:00 +02:00
parent e06d4fee00
commit 33567e6190

View file

@ -76,18 +76,18 @@
insertafter: '^PATH' insertafter: '^PATH'
line: 'MAILTO={{ notify_email }}' line: 'MAILTO={{ notify_email }}'
- name: Turn off SSH password auth - name: Configure SSH
lineinfile: lineinfile:
path: /etc/ssh/sshd_config path: /etc/ssh/sshd_config
regexp: '^#?PasswordAuthentication' regexp: "{{ item.regexp }}"
line: 'PasswordAuthentication no' line: "{{ item.line }}"
notify: reload sshd with_items:
- regexp: '^#?Port'
- name: Configure SSH port line: 'Port {{ ssh_port }}'
lineinfile: - regexp: '^#?PasswordAuthentication'
path: /etc/ssh/sshd_config line: 'PasswordAuthentication no'
regexp: '^#?Port' - regexp: '^#?DebianBanner'
line: 'Port {{ ssh_port }}' line: 'DebianBanner no'
notify: reload sshd notify: reload sshd
- name: Allow SSH - name: Allow SSH