]> review.fuel-infra Code Review - puppet-modules/puppetlabs-firewall.git/commitdiff
(MODULES-1984) Perform daemon-reload on systemd
authorJohn Duarte <john.duarte@puppetlabs.com>
Tue, 28 Apr 2015 20:07:31 +0000 (13:07 -0700)
committerJohn Duarte <john.duarte@puppetlabs.com>
Tue, 28 Apr 2015 20:07:31 +0000 (13:07 -0700)
This commit patches the `manifests/linux/redhat.pp` manifest to
perform a `systemctl daemon-reload` exec on platforms that also
contain firewalld.

Prior to this commit, Specifically on Centos 7, if the systemd
deamon is not reloaded then the iptables service fails to start
because it cannot see the systemd Unit for that service.

This patch refreshes the daemon's list of Units and allows the
service to start as expected.

manifests/linux/redhat.pp

index 21e509267941ce50953faebb33947624acada0d1..9a33abbd367a0d21fbde2fbdf2c937ba071c7da5 100644 (file)
@@ -39,6 +39,14 @@ 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],
+    }
+  }
+
   service { $service_name:
     ensure    => $ensure,
     enable    => $enable,