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
2020-09-23 22:22:34 +02:00

29 lines
798 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: set file permissions
file: path=/etc/ssh mode=0600
- name: install motd
template: src=motd.j2 dest=/etc/motd owner=root group=root mode=0644
- name: Create the includes dir
file: path="{{ sshd_includes_dir }}" state=directory mode=0600
when: sshd_enable_includes
- name: start and enable sshd
service: name=sshd enabled=yes state=started
- name: open firewall holes
ansible.posix.firewalld: service=ssh permanent=true state=enabled immediate=yes
when: configure_firewall is defined and configure_firewall
tags:
- firewall