1
1
mirror of https://gitlab.archlinux.org/archlinux/infrastructure.git synced 2025-01-18 08:06:16 +01:00
infrastructure/roles/sshd/tasks/main.yml
Evangelos Foutras 8e6d5474e4
sshd: use drop-in for basic sshd configuration
This saves us from having to rebase on every upstream config change.
2023-08-13 22:35:54 +03:00

20 lines
761 B
YAML

- name: Install openssh
pacman: name=openssh state=present
- name: Configure sshd via drop-in
template: src=sshd_config.j2 dest=/etc/ssh/sshd_config.d/override.conf owner=root group=root mode=0644 validate='/usr/sbin/sshd -t -f %s'
notify:
- Restart sshd
- name: Install motd
template: src=motd.j2 dest=/etc/motd owner=root group=root mode=0644
- name: Start and enable sshd
service: name=sshd enabled=yes state=started
- name: Open firewall holes
ansible.posix.firewalld: service={{ 'ssh' if ansible_port is not defined else omit }} port={{ "%d/tcp" | format(ansible_port) if ansible_port is defined else omit }} permanent=true state=enabled immediate=yes
when: configure_firewall is defined and configure_firewall
tags:
- firewall