1
1
mirror of https://gitlab.archlinux.org/archlinux/infrastructure.git synced 2025-01-18 08:06:16 +01:00
infrastructure/roles/syncrepo/tasks/main.yml
Evangelos Foutras a782c6953f
syncrepo: let mirrorsync perform the repo syncing
This role will still handle setting up nginx and rsyncd, due to specific
configuration requirements these services have.

We're also effectively relieving build.archlinux.org of rsyncd duties as
it is not something it should be doing anyway.
2022-11-12 20:22:08 +02:00

44 lines
1.3 KiB
YAML

- name: Create ssl cert
include_role:
name: certificate
vars:
domains: ["{{ mirror_domain }}"]
when: 'mirror_domain is defined'
- name: Create ssl cert for geo mirror
include_role:
name: certificate
vars:
domains: ["{{ geo_mirror_domain }}"]
challenge: "DNS-01"
when: "'geo_mirrors' in group_names"
- name: Install rsync
pacman: name=rsync state=present
- name: Install rsyncd config
copy: src=rsyncd.conf dest=/etc/rsyncd.conf owner=root group=root mode=0644
- name: Start and enable rsyncd.socket
service: name=rsyncd.socket enabled=yes state=started
- name: Make nginx log dirs
file: path=/var/log/nginx/{{ item }} state=directory owner=root group=root mode=0755
loop: "{{ [mirror_domain, geo_mirror_domain] if 'geo_mirrors' in group_names else [mirror_domain] }}"
when: 'mirror_domain is defined'
- name: Set up nginx
template: src=nginx.d.conf.j2 dest=/etc/nginx/nginx.d/syncrepo.conf owner=root group=root mode=0644
vars:
mirror_domains: "{{ [mirror_domain, geo_mirror_domain] if 'geo_mirrors' in group_names else [mirror_domain] }}"
notify:
- Reload nginx
when: 'mirror_domain is defined'
tags: ['nginx']
- name: Open firewall holes
ansible.posix.firewalld: service=rsyncd permanent=true state=enabled immediate=yes
when: configure_firewall
tags:
- firewall