1
1
Fork 0
mirror of https://gitlab.archlinux.org/archlinux/infrastructure.git synced 2024-05-21 15:16:15 +02:00
infrastructure/roles/sshd/tasks/main.yml
Evangelos Foutras 404f8b3aae
sshd: remove support for custom ssh.d directory
The same drop-in functionality is now provided by the openssh package
via /etc/ssh/sshd_config.d/.
2023-08-13 22:06:10 +03:00

20 lines
733 B
YAML

- name: Install openssh
pacman: name=openssh state=present
- name: Configure sshd
template: src=sshd_config.j2 dest=/etc/ssh/sshd_config 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