mirror of
https://gitlab.archlinux.org/archlinux/infrastructure.git
synced 2026-09-19 13:39:07 +02:00
The server only has a public IPv6 address and a DNATed (port forwarded) SSH port for accessing the server over IPv4. So this commit contains some changes for supporting that. Co-authored-by: Kristian Klausen <kristian@klausen.dk>
20 lines
738 B
YAML
20 lines
738 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 sshd_port == 22 else omit }} port={{ "%d/tcp" | format(sshd_port) if sshd_port != 22 else omit }} permanent=true state=enabled immediate=yes
|
|
when: configure_firewall is defined and configure_firewall
|
|
tags:
|
|
- firewall
|