Dzahn has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/334467 )

Change subject: aptrepo/rsync: flip the "if"-logic around instead of a negation
......................................................................


aptrepo/rsync: flip the "if"-logic around instead of a negation

Avoid using a negation, make the logic more obvious.

Also, fix the rsync command, missing trailing / after dir.

Change-Id: I95bf8b121870a4a8b2be9268e881c57e6da86f5b
---
M modules/aptrepo/manifests/rsync.pp
1 file changed, 8 insertions(+), 7 deletions(-)

Approvals:
  jenkins-bot: Verified
  Dzahn: Looks good to me, approved



diff --git a/modules/aptrepo/manifests/rsync.pp 
b/modules/aptrepo/manifests/rsync.pp
index 9eabac9..079ab22 100644
--- a/modules/aptrepo/manifests/rsync.pp
+++ b/modules/aptrepo/manifests/rsync.pp
@@ -6,7 +6,13 @@
     $secondary_server = hiera('install_server_failover', 
'install2002.wikimedia.org')
 
     # only activate rsync/firewall hole on the server that is NOT active
-    if $::fqdn != $primary_server {
+    if $::fqdn == $primary_server {
+
+        $ensure_ferm = 'absent'
+        $ensure_cron = 'present'
+        $ensure_sync = 'absent'
+
+    } else {
 
         $ensure_ferm = 'present'
         $ensure_cron = 'absent'
@@ -28,11 +34,6 @@
             read_only   => 'no',
             hosts_allow => $primary_server,
         }
-
-    } else {
-        $ensure_ferm = 'absent'
-        $ensure_cron = 'present'
-        $ensure_sync = 'absent'
     }
 
     ferm::service { 'aptrepo-rsync':
@@ -45,7 +46,7 @@
     cron { 'rsync-aptrepo':
         ensure  => $ensure_cron,
         user    => 'root',
-        command => "rsync -avp ${aptrepo::basedir} 
rsync://${secondary_server}/aptrepo",
+        command => "rsync -avp ${aptrepo::basedir}/ 
rsync://${secondary_server}/aptrepo",
         hour    => '*/6',
         minute  => '42',
     }

-- 
To view, visit https://gerrit.wikimedia.org/r/334467
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I95bf8b121870a4a8b2be9268e881c57e6da86f5b
Gerrit-PatchSet: 5
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Dzahn <dz...@wikimedia.org>
Gerrit-Reviewer: Dzahn <dz...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to