From df3950766b0815dceaed91100ec042160122eeaa Mon Sep 17 00:00:00 2001 From: shirenn Date: Mon, 5 Dec 2022 11:28:52 +0100 Subject: [PATCH] [apt-mirror] Gardening --- group_vars/mirror_backend.yml | 24 ++++++++++++++++--- roles/apt-mirror/tasks/main.yml | 1 + .../templates/rsync-mirror-cron.j2 | 2 +- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/group_vars/mirror_backend.yml b/group_vars/mirror_backend.yml index 531d60bf..ac3ea2c1 100644 --- a/group_vars/mirror_backend.yml +++ b/group_vars/mirror_backend.yml @@ -41,9 +41,10 @@ glob_rsync_mirror: dest: distributions/linux/debian/cloud cron_time: "00 5" rsync_host: cdimage.debian.org - rsync_path: cdimage/cloud/OpenStack + rsync_path: cdimage/cloud/bullseye exclude: - archive + - daily - name: ubuntu dest: distributions/linux/ubuntu cron_time: "00 5" @@ -72,7 +73,7 @@ glob_rsync_mirror: - name: archlinux dest: archlinux cron_time: "08 3,15" - rsync_host: archlinux.polymorf.fr + rsync_host: rsync.cyberbits.eu rsync_path: archlinux/ glob_apt_mirror: @@ -89,7 +90,7 @@ glob_apt_mirror: - main - name: proxmox symlink: "" - scheme: http + scheme: https host: download.proxmox.com path: debian/pve suite: @@ -97,3 +98,20 @@ glob_apt_mirror: - bullseye components: - pve-no-subscription + - name: ceph-quincy + scheme: https + host: download.proxmox.com + path: debian/ceph-quincy + suite: + - bullseye + components: + - main + - name: ceph-quincy + symlink: "" + scheme: https + host: download.ceph.com + path: debian-quincy + suite: + - bullseye + components: + - main diff --git a/roles/apt-mirror/tasks/main.yml b/roles/apt-mirror/tasks/main.yml index 6367c476..449aacc5 100644 --- a/roles/apt-mirror/tasks/main.yml +++ b/roles/apt-mirror/tasks/main.yml @@ -24,6 +24,7 @@ mode: 0755 state: link loop: "{{ apt_mirror.targets }}" + when: item.symlink is defined - name: Copy apt-mirror configurations template: diff --git a/roles/rsync-mirror/templates/rsync-mirror-cron.j2 b/roles/rsync-mirror/templates/rsync-mirror-cron.j2 index 35ea881a..4172e03c 100644 --- a/roles/rsync-mirror/templates/rsync-mirror-cron.j2 +++ b/roles/rsync-mirror/templates/rsync-mirror-cron.j2 @@ -1,4 +1,4 @@ {{ ansible_header | comment }} {% for i in rsync_mirror.targets %} -{{ i.cron_time }} * * * mirror rsync --times --links --hard-links --partial --block-size=8192 --recursive --exclude *-dvd-* --exclude source/ --verbose --stats --delete-after {%for exclude in i.exclude | default([]) %}--exclude {{ exclude }} {% endfor %}rsync://{{ i.rsync_host }}/{{ i.rsync_path }} {{ rsync_mirror.root }}/{{ i.dest }} | tee -a "/var/log/mirror/{{ i.name }}.log" > /dev/null +{{ i.cron_time }} * * * mirror rsync --times --links --hard-links --partial --block-size=8192 --recursive --exclude *-dvd-* --exclude *.raw --exclude source/ --verbose --stats --delete-after {%for exclude in i.exclude | default([]) %}--exclude {{ exclude }} {% endfor %}rsync://{{ i.rsync_host }}/{{ i.rsync_path }} {{ rsync_mirror.root }}/{{ i.dest }} | tee -a "/var/log/mirror/{{ i.name }}.log" > /dev/null {% endfor %}