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 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 %> "