infra/ansible/roles/base/tasks/system.yml
2025-07-23 12:34:33 -05:00

31 lines
No EOL
620 B
YAML

---
# System configuration tasks
- name: Install SSH banner
template:
src: issue.net.j2
dest: /etc/issue.net
mode: '0644'
tags:
- ssh
- name: Configure SSH to use banner
lineinfile:
path: /etc/ssh/sshd_config
regexp: '^Banner'
line: 'Banner /etc/issue.net'
state: present
notify: restart ssh
tags:
- ssh
# Uncomment if you want to disable root SSH access
# - name: Disallow root SSH access
# lineinfile:
# path: /etc/ssh/sshd_config
# regexp: "^PermitRootLogin"
# line: "PermitRootLogin no"
# state: present
# notify: restart ssh
# tags:
# - ssh