- name: sshd configuration
lineinfile:
dest: /etc/ssh/sshd_config
line: "{{ item.src }}"
regexp: '^{{ item.dest }}'
insertafter: EOF
loop:
- src: MaxAuthTries
dest: MaxAuthTries 4
- src: PermitRootLogin
dest: PermitRootLogin no
- src: ClientAliveInterval
dest: ClientAliveInterval 300
- src: LoginGraceTime
dest: LoginGraceTime 60
- src: Banner
dest: Banner /etc/issue.net
- src: PermitEmptyPasswords
dest: PermitEmptyPasswords no