mirror of
https://gitlab.archlinux.org/archlinux/infrastructure.git
synced 2024-05-05 16:26:03 +02:00
4112bdf9fd
yaml: truthy value should be one of [false, true] (truthy) yaml: wrong indentation: expected 4 but found 2 (indentation) yaml: too few spaces before comment (comments) yaml: missing starting space in comment (comments) yaml: too many blank lines (1 > 0) (empty-lines) yaml: too many spaces after colon (colons) yaml: comment not indented like content (comments-indentation) yaml: no new line character at the end of file (new-line-at-end-of-file) load-failure: Failed to load or parse file parser-error: couldn't resolve module/action 'hosts'. This often indicates a misspelling, missing collection, or incorrect module path.
61 lines
1.6 KiB
YAML
61 lines
1.6 KiB
YAML
---
|
|
|
|
- name: create ssl cert
|
|
include_role:
|
|
name: certificate
|
|
vars:
|
|
domains: ["{{ mirror_domain }}"]
|
|
when: 'mirror_domain is defined'
|
|
|
|
- name: install rsync
|
|
pacman: name=rsync state=present
|
|
|
|
- name: install syncrepo script
|
|
copy: src=syncrepo dest=/usr/local/bin/syncrepo owner=root group=root mode=0755
|
|
|
|
- name: install syncrepo units
|
|
copy: src={{ item }} dest=/etc/systemd/system/{{ item }} owner=root group=root mode=0644
|
|
with_items:
|
|
- syncrepo.timer
|
|
- syncrepo.service
|
|
|
|
- name: install rsyncd config
|
|
copy: src=rsyncd.conf dest=/etc/rsyncd.conf owner=root group=root mode=0644
|
|
|
|
- name: start and enable syncrepo units
|
|
systemd:
|
|
name: "{{ item }}"
|
|
enabled: true
|
|
state: started
|
|
daemon_reload: true
|
|
with_items:
|
|
- syncrepo.timer
|
|
- rsyncd.socket
|
|
|
|
- name: set local mirror as cachedir
|
|
lineinfile:
|
|
dest: /etc/pacman.conf
|
|
insertafter: '^#CacheDir'
|
|
regexp: '^CacheDir'
|
|
line: 'CacheDir = /var/cache/pacman/pkg/ /srv/ftp/pool/packages/ /srv/ftp/pool/community/'
|
|
mode: 0644
|
|
owner: root
|
|
group: root
|
|
|
|
- name: make nginx log dir
|
|
file: path=/var/log/nginx/{{ mirror_domain }} state=directory owner=root group=root mode=0755
|
|
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
|
|
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
|