]> review.fuel-infra Code Review - puppet-modules/puppetlabs-firewall.git/commitdiff
Fixed idempotency bug relating to MODULES-1984
authorJonathan Tripathy <jt@puppetlabs.com>
Tue, 5 May 2015 15:52:55 +0000 (16:52 +0100)
committerJonathan Tripathy <jt@puppetlabs.com>
Tue, 5 May 2015 15:52:55 +0000 (16:52 +0100)
manifests/linux/redhat.pp

index 9a33abbd367a0d21fbde2fbdf2c937ba071c7da5..36571bba93e6eb144cf93d479b22603c27bcef25 100644 (file)
@@ -42,8 +42,12 @@ class firewall::linux::redhat (
   if ($::operatingsystem != 'Amazon')
   and (($::operatingsystem != 'Fedora' and versioncmp($::operatingsystemrelease, '7.0') >= 0)
   or  ($::operatingsystem == 'Fedora' and versioncmp($::operatingsystemrelease, '15') >= 0)) {
-    exec { '/usr/bin/systemctl daemon-reload':
-      require   => Package[$package_name],
+    if $ensure == 'running' {
+      exec { '/usr/bin/systemctl daemon-reload':
+        require   => Package[$package_name],
+        before    => Service[$service_name],
+        unless    => '/usr/bin/systemctl is-active iptables'
+      }
     }
   }