From e8c9e6e7bc404e237642c208c67ad148683aa69f Mon Sep 17 00:00:00 2001 From: Olaf Alders Date: Tue, 7 Oct 2025 16:01:06 +0100 Subject: [PATCH 1/8] Temporarily switch to a new CPAN rsync host We will revert this once the main mirror is back online, so we don't need to use a variable for the hostname in this case. --- modules/rrrclient/manifests/cron.pp | 2 +- modules/rrrclient/templates/init.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/rrrclient/manifests/cron.pp b/modules/rrrclient/manifests/cron.pp index faf15586..af436cc3 100644 --- a/modules/rrrclient/manifests/cron.pp +++ b/modules/rrrclient/manifests/cron.pp @@ -29,7 +29,7 @@ 'metacpan_daily_rsync': user => $user, # NOTE: No "--delete" arg since we're also a backpan. - command => "/usr/bin/rsync -a cpan-rsync.perl.org::CPAN ${cpan_mirror}", + command => "/usr/bin/rsync -a 23.29.118.28::PAUSE ${cpan_mirror}", hour => '23', minute => '13', ensure => $ensure; diff --git a/modules/rrrclient/templates/init.erb b/modules/rrrclient/templates/init.erb index 01158b10..e325137a 100755 --- a/modules/rrrclient/templates/init.erb +++ b/modules/rrrclient/templates/init.erb @@ -30,7 +30,7 @@ test -x $BIN || { echo "$BIN not installed"; case "$1" in start) echo -n "Starting <%= @filename %> " - start-stop-daemon --start --background -c <%= @owner %> -m -p <%= @pid_file %> --startas <%= @bin %> -- --source cpan-rsync.perl.org::CPAN/RECENT.recent --target <%= @cpan_mirror %> --skip-deletes + start-stop-daemon --start --background -c <%= @owner %> -m -p <%= @pid_file %> --startas <%= @bin %> -- --source 23.29.118.28::PAUSE/RECENT.recent --target <%= @cpan_mirror %> --skip-deletes ;; stop) echo -n "Shutting down <%= @filename %> " From e746cb64757f464d51efa26a8a47b36d6fd90095 Mon Sep 17 00:00:00 2001 From: Olaf Alders Date: Tue, 7 Oct 2025 16:04:39 -0400 Subject: [PATCH 2/8] run rsync throughout the day as a stopgap We cannot run rrr-client on the top level pop-up-pause-rsync because it contains some fails which may or may not still be in CPAN. Instead we need to mirror ./modules and ./authors. It would complicate the init script for the rrr-client to do it there, so let's just run rsync every 15 minutes or so to start with and see if that works. --- modules/rrrclient/manifests/cron.pp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/rrrclient/manifests/cron.pp b/modules/rrrclient/manifests/cron.pp index af436cc3..1543e4ed 100644 --- a/modules/rrrclient/manifests/cron.pp +++ b/modules/rrrclient/manifests/cron.pp @@ -29,9 +29,8 @@ 'metacpan_daily_rsync': user => $user, # NOTE: No "--delete" arg since we're also a backpan. - command => "/usr/bin/rsync -a 23.29.118.28::PAUSE ${cpan_mirror}", - hour => '23', - minute => '13', + command => "/usr/bin/rsync -a 23.29.118.28::PAUSE/authors/ ${cpan_mirror}/authors/ && /usr/bin/rsync -a 23.29.118.28::PAUSE/modules/ ${cpan_mirror}/modules/", + minute => '*/15', ensure => $ensure; } } From d9354fc83206ab4188b53d0803140b10053f0887 Mon Sep 17 00:00:00 2001 From: Olaf Alders Date: Tue, 7 Oct 2025 18:37:49 -0400 Subject: [PATCH 3/8] Explicitly set wildcard for cron hour puppet leaves the hour untouches if it's not provided, so we ended up with a cron that ran every 15 minutes only in the 23rd hour --- modules/rrrclient/manifests/cron.pp | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/rrrclient/manifests/cron.pp b/modules/rrrclient/manifests/cron.pp index 1543e4ed..8ffec418 100644 --- a/modules/rrrclient/manifests/cron.pp +++ b/modules/rrrclient/manifests/cron.pp @@ -30,6 +30,7 @@ user => $user, # NOTE: No "--delete" arg since we're also a backpan. command => "/usr/bin/rsync -a 23.29.118.28::PAUSE/authors/ ${cpan_mirror}/authors/ && /usr/bin/rsync -a 23.29.118.28::PAUSE/modules/ ${cpan_mirror}/modules/", + hour => '*', minute => '*/15', ensure => $ensure; } From 57c492aed40f0845c58e2e8100d0b6b47d0d6fee Mon Sep 17 00:00:00 2001 From: Olaf Alders Date: Thu, 9 Oct 2025 22:10:10 +0100 Subject: [PATCH 4/8] Revert "Explicitly set wildcard for cron hour" This reverts commit d9354fc83206ab4188b53d0803140b10053f0887. --- modules/rrrclient/manifests/cron.pp | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/rrrclient/manifests/cron.pp b/modules/rrrclient/manifests/cron.pp index 8ffec418..1543e4ed 100644 --- a/modules/rrrclient/manifests/cron.pp +++ b/modules/rrrclient/manifests/cron.pp @@ -30,7 +30,6 @@ user => $user, # NOTE: No "--delete" arg since we're also a backpan. command => "/usr/bin/rsync -a 23.29.118.28::PAUSE/authors/ ${cpan_mirror}/authors/ && /usr/bin/rsync -a 23.29.118.28::PAUSE/modules/ ${cpan_mirror}/modules/", - hour => '*', minute => '*/15', ensure => $ensure; } From bebce0c10b690b22b32371b88c9f11d9452ebe46 Mon Sep 17 00:00:00 2001 From: Olaf Alders Date: Thu, 9 Oct 2025 22:10:30 +0100 Subject: [PATCH 5/8] Revert "run rsync throughout the day as a stopgap" This reverts commit e746cb64757f464d51efa26a8a47b36d6fd90095. --- modules/rrrclient/manifests/cron.pp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/rrrclient/manifests/cron.pp b/modules/rrrclient/manifests/cron.pp index 1543e4ed..af436cc3 100644 --- a/modules/rrrclient/manifests/cron.pp +++ b/modules/rrrclient/manifests/cron.pp @@ -29,8 +29,9 @@ 'metacpan_daily_rsync': user => $user, # NOTE: No "--delete" arg since we're also a backpan. - command => "/usr/bin/rsync -a 23.29.118.28::PAUSE/authors/ ${cpan_mirror}/authors/ && /usr/bin/rsync -a 23.29.118.28::PAUSE/modules/ ${cpan_mirror}/modules/", - minute => '*/15', + command => "/usr/bin/rsync -a 23.29.118.28::PAUSE ${cpan_mirror}", + hour => '23', + minute => '13', ensure => $ensure; } } From 0fadb837465c29027da9e3f5069bd25a74fa9a89 Mon Sep 17 00:00:00 2001 From: Olaf Alders Date: Thu, 9 Oct 2025 22:10:48 +0100 Subject: [PATCH 6/8] Revert "Temporarily switch to a new CPAN rsync host" This reverts commit e8c9e6e7bc404e237642c208c67ad148683aa69f. --- modules/rrrclient/manifests/cron.pp | 2 +- modules/rrrclient/templates/init.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/rrrclient/manifests/cron.pp b/modules/rrrclient/manifests/cron.pp index af436cc3..faf15586 100644 --- a/modules/rrrclient/manifests/cron.pp +++ b/modules/rrrclient/manifests/cron.pp @@ -29,7 +29,7 @@ 'metacpan_daily_rsync': user => $user, # NOTE: No "--delete" arg since we're also a backpan. - command => "/usr/bin/rsync -a 23.29.118.28::PAUSE ${cpan_mirror}", + command => "/usr/bin/rsync -a cpan-rsync.perl.org::CPAN ${cpan_mirror}", hour => '23', minute => '13', ensure => $ensure; diff --git a/modules/rrrclient/templates/init.erb b/modules/rrrclient/templates/init.erb index e325137a..01158b10 100755 --- a/modules/rrrclient/templates/init.erb +++ b/modules/rrrclient/templates/init.erb @@ -30,7 +30,7 @@ test -x $BIN || { echo "$BIN not installed"; case "$1" in start) echo -n "Starting <%= @filename %> " - start-stop-daemon --start --background -c <%= @owner %> -m -p <%= @pid_file %> --startas <%= @bin %> -- --source 23.29.118.28::PAUSE/RECENT.recent --target <%= @cpan_mirror %> --skip-deletes + start-stop-daemon --start --background -c <%= @owner %> -m -p <%= @pid_file %> --startas <%= @bin %> -- --source cpan-rsync.perl.org::CPAN/RECENT.recent --target <%= @cpan_mirror %> --skip-deletes ;; stop) echo -n "Shutting down <%= @filename %> " From ff0536d334ab0b4cddd9f1d5a8304ff5fe304ddf Mon Sep 17 00:00:00 2001 From: Leo Lapworth Date: Sun, 26 Oct 2025 08:30:30 +0000 Subject: [PATCH 7/8] Make rrr and the rsync cron user a variable for the server --- hieradata/common.yaml | 2 ++ modules/rrrclient/manifests/cron.pp | 3 ++- modules/rrrclient/manifests/service.pp | 1 + modules/rrrclient/templates/init.erb | 2 +- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/hieradata/common.yaml b/hieradata/common.yaml index 7b9d8ae4..56a78225 100644 --- a/hieradata/common.yaml +++ b/hieradata/common.yaml @@ -86,6 +86,8 @@ metacpan::watcher::enable: false # We don't want to have CPAN synced metacpan::rrrclient::enable: false +# Default server to use +metacpan::rrrclient::server: 'cpan-rsync.perl.org' # Elasticsearch basic options metacpan::elasticsearch::version: 2.4.3 diff --git a/modules/rrrclient/manifests/cron.pp b/modules/rrrclient/manifests/cron.pp index faf15586..acc5fdf5 100644 --- a/modules/rrrclient/manifests/cron.pp +++ b/modules/rrrclient/manifests/cron.pp @@ -2,6 +2,7 @@ $ensure = absent, $cpan_mirror, $user = hiera('metacpan::user', 'metacpan'), + $rrr_server = hiera('metacpan::rrrclient::server'), ) { # BARBIE pointed out an issue where rrr_client misses arbitrary uploads. He and @@ -29,7 +30,7 @@ 'metacpan_daily_rsync': user => $user, # NOTE: No "--delete" arg since we're also a backpan. - command => "/usr/bin/rsync -a cpan-rsync.perl.org::CPAN ${cpan_mirror}", + command => "/usr/bin/rsync -a ${rrr_server}::CPAN ${cpan_mirror}", hour => '23', minute => '13', ensure => $ensure; diff --git a/modules/rrrclient/manifests/service.pp b/modules/rrrclient/manifests/service.pp index 0993dedc..0e64b15a 100644 --- a/modules/rrrclient/manifests/service.pp +++ b/modules/rrrclient/manifests/service.pp @@ -3,6 +3,7 @@ $cpan_mirror, $pid_file = "/var/run/rrrclient-$name.pid", $enable = false, + $rrr_server = hiera('metacpan::rrrclient::server'), ) { include perl perl::module{ 'File::Rsync::Mirror::Recent': diff --git a/modules/rrrclient/templates/init.erb b/modules/rrrclient/templates/init.erb index 01158b10..e42f9adb 100755 --- a/modules/rrrclient/templates/init.erb +++ b/modules/rrrclient/templates/init.erb @@ -30,7 +30,7 @@ test -x $BIN || { echo "$BIN not installed"; case "$1" in start) echo -n "Starting <%= @filename %> " - start-stop-daemon --start --background -c <%= @owner %> -m -p <%= @pid_file %> --startas <%= @bin %> -- --source cpan-rsync.perl.org::CPAN/RECENT.recent --target <%= @cpan_mirror %> --skip-deletes + start-stop-daemon --start --background -c <%= @owner %> -m -p <%= @pid_file %> --startas <%= @bin %> -- --source <%= @rrr_server %>::CPAN/RECENT.recent --target <%= @cpan_mirror %> --skip-deletes ;; stop) echo -n "Shutting down <%= @filename %> " From 61c2e7dff18b1f72b547dd2aa05e240da8ca6dca Mon Sep 17 00:00:00 2001 From: Leo Lapworth Date: Sun, 26 Oct 2025 08:31:12 +0000 Subject: [PATCH 8/8] Get puppet looking for a private hiera file which we can symlink in --- hiera.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/hiera.yaml b/hiera.yaml index 4305924d..117e5cc2 100644 --- a/hiera.yaml +++ b/hiera.yaml @@ -8,4 +8,5 @@ - "nodes/%{hostname}" - "datacenter/%{datacenter}" - "env/%{env}" + - private/common - common