mirror: Lint fixes

This commit is contained in:
Timo Makinen 2023-10-12 18:32:40 +00:00
parent ee25d32b60
commit 70cdfd4612
7 changed files with 38 additions and 37 deletions

View file

@ -33,19 +33,19 @@
sitename: foo.sh
password: "{{ report_mirror_pass }}"
- role: mirror/sync
label: fedora-epel
source: "rsync://rsync.nic.funet.fi/ftp/pub/mirrors/\
fedora.redhat.com/pub/epel"
rsyncoptions:
mirror_label: fedora-epel
mirror_source:
"rsync://rsync.nic.funet.fi/ftp/pub/mirrors/fedora.redhat.com/pub/epel"
mirror_rsyncoptions:
- "--exclude=SRPMS"
- "--exclude=debug"
- "--delete-excluded"
postcmd: python3 /usr/local/bin/report_mirror
mirror_postcmd: python3 /usr/local/bin/report_mirror
- role: mirror/sync
label: fedora
source: "rsync://rsync.nic.funet.fi/ftp/pub/mirrors/\
fedora.redhat.com/pub/fedora/linux/"
rsyncoptions:
mirror_label: fedora
mirror_source:
"rsync://rsync.nic.funet.fi/ftp/pub/mirrors/fedora.redhat.com/pub/fedora/linux/"
mirror_rsyncoptions:
- "--exclude=/atomic"
- "--exclude=/development"
- "--exclude=/releases/test"
@ -58,12 +58,12 @@
- "--exclude=armhfp"
- "--exclude=debug"
- "--delete-excluded"
postcmd: python3 /usr/local/bin/report_mirror
mirror_postcmd: python3 /usr/local/bin/report_mirror
- role: mirror/sync
label: openbsd
source: "rsync://rsync.nic.funet.fi/ftp/pub/mirrors/\
ftp.openbsd.org/pub/OpenBSD/"
rsyncoptions:
mirror_label: openbsd
mirror_source:
"rsync://rsync.nic.funet.fi/ftp/pub/mirrors/ftp.openbsd.org/pub/OpenBSD/"
mirror_rsyncoptions:
- "--include=/?.?/"
- "--include=/?.?/amd64/"
- "--include=/?.?/amd64/*"

View file

@ -23,7 +23,7 @@
ansible.builtin.file:
path: /export/mirrors
state: directory
mode: 0755
mode: "0755"
owner: root
group: root
@ -44,7 +44,7 @@
ansible.builtin.file:
path: /etc/sync-mirrors
state: directory
mode: 0755
mode: "0755"
owner: root
group: root
@ -52,7 +52,7 @@
ansible.builtin.file:
path: "{{ item }}"
state: directory
mode: 0755
mode: "0755"
owner: mirror
group: mirror
with_items:
@ -63,7 +63,7 @@
ansible.builtin.copy:
dest: /usr/lib/tmpfiles.d/sync-mirrors.conf
content: "d /run/sync-mirrors 0755 mirror mirror\n"
mode: 0644
mode: "0644"
owner: root
group: root
@ -71,7 +71,7 @@
ansible.builtin.copy:
dest: /usr/local/bin/sync-mirrors
src: sync-mirrors
mode: 0755
mode: "0755"
owner: root
group: root
@ -110,7 +110,7 @@
ansible.builtin.template:
src: mirror.conf.j2
dest: /etc/httpd/conf.local.d/mirror.conf
mode: 0644
mode: "0644"
owner: root
group: "{{ ansible_wheel }}"
notify: Restart apache

View file

@ -8,13 +8,14 @@
ansible.builtin.git:
dest: /usr/local/src/report_mirror
repo: https://github.com/fedora-infra/mirrormanager2.git
update: true
version: master
- name: Install reportmirror script
ansible.builtin.copy:
dest: /usr/local/bin/report_mirror
src: /usr/local/src/report_mirror/client/report_mirror
mode: 0755
mode: "0755"
owner: root
group: "{{ ansible_wheel }}"
remote_src: true
@ -23,7 +24,7 @@
ansible.builtin.file:
dest: /etc/mirrormanager-client
state: directory
mode: 0750
mode: "0750"
owner: root
group: mirror
@ -31,6 +32,6 @@
ansible.builtin.template:
dest: /etc/mirrormanager-client/report_mirror.conf
src: report_mirror.conf.j2
mode: 0640
mode: "0640"
owner: root
group: mirror

View file

@ -1,3 +1,3 @@
---
rsyncoptions: []
postcmd: ""
mirror_rsyncoptions: []
mirror_postcmd: ""

View file

@ -1,24 +1,24 @@
---
- name: Create config for {{ label }}
- name: Create config for {{ mirror_label }}
ansible.builtin.template:
dest: "/etc/sync-mirrors/{{ label }}.conf"
dest: "/etc/sync-mirrors/{{ mirror_label }}.conf"
src: mirror.conf.j2
mode: 0644
mode: "0644"
owner: root
group: root
- name: Create target directory
ansible.builtin.file:
path: "/srv/mirrors/{{ label }}"
path: "/srv/mirrors/{{ mirror_label }}"
state: directory
mode: 0755
mode: "0755"
owner: mirror
group: mirror
- name: Link target directory to web
ansible.builtin.file:
path: "/srv/web/{{ inventory_hostname }}/{{ label }}"
src: "/srv/mirrors/{{ label }}"
path: "/srv/web/{{ inventory_hostname }}/{{ mirror_label }}"
src: "/srv/mirrors/{{ mirror_label }}"
state: link
owner: mirror
group: mirror

View file

@ -1,3 +1,3 @@
SRC="{{ source }}"
RSYNCOPTS="{{ rsyncoptions | join(' ') }}"
POSTCMD="{{ postcmd }}"
SRC="{{ mirror_source }}"
RSYNCOPTS="{{ mirror_rsyncoptions | join(' ') }}"
POSTCMD="{{ mirror_postcmd }}"

View file

@ -11,7 +11,7 @@
ansible.builtin.file:
path: /srv/mirrors/thinlinc
state: directory
mode: 0755
mode: "0755"
owner: mirror
group: mirror
@ -28,7 +28,7 @@
ansible.builtin.copy:
dest: /usr/local/bin/sync-thinlinc-repo
src: sync-thinlinc-repo.sh
mode: 0755
mode: "0755"
owner: root
group: root