Since the autobefore fix on the firewall type is not available for puppet 3,
this re-adds the RHEL7 workaround if we're running on puppet 3.
group => 'root',
mode => '0600',
}
+
+ # Before puppet 4, the autobefore on the firewall type does not work - therefore
+ # we need to keep this workaround here
+ if versioncmp($::puppetversion, '4.0') <= 0 {
+ File["/etc/sysconfig/${service_name}"] -> Service[$service_name]
+
+ # Redhat 7 selinux user context for /etc/sysconfig/iptables is set to unconfined_u
+ case $::selinux {
+ #lint:ignore:quoted_booleans
+ 'true',true: {
+ case $::operatingsystemrelease {
+ /^(6|7)\..*/: { File["/etc/sysconfig/${service_name}"] { seluser => 'unconfined_u' } }
+ default: { File["/etc/sysconfig/${service_name}"] { seluser => 'system_u' } }
+ }
+ }
+ default: {}
+ #lint:endignore
+ }
+ }
}