Skip to content

Commit ed17c40

Browse files
Put selboolean{'zabbix_can_network'} inside ensure_resources
puppet-zabbix module depends on stdlib, `ensure_resources` is already availble for usage. My motivation for this change is global declaration that zabbix_can_network and zabbix server belongs to this global declaration. ensure_resource allows for resource duplication as long as declaration of those resource is identical. Also, notifying service dependency is useless IMO, as SELinux and ZBX are separate things and ZBX doesn't need to be restarted in order to make SELinux policies to be applied.
1 parent 1772fdd commit ed17c40

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

manifests/server.pp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -567,15 +567,18 @@
567567
}
568568
# check if selinux is active and allow zabbix
569569
if $facts['selinux'] == true and $manage_selinux {
570-
selboolean{'zabbix_can_network':
571-
persistent => true,
572-
value => 'on',
573-
notify => $dependency,
574-
}
575-
-> selinux::module{'zabbix-server':
570+
ensure_resource ('selboolean',
571+
[
572+
'zabbix_can_network',
573+
], {
574+
persistent => true,
575+
value => 'on',
576+
})
577+
selinux::module{'zabbix-server':
576578
ensure => 'present',
577579
source_te => 'puppet:///modules/zabbix/zabbix-server.te',
578580
before => $dependency,
581+
require => Selboolean['zabbix_can_network']
579582
}
580583
# zabbix-server 3.4 introduced IPC via a socket in /tmp
581584
# https://support.zabbix.com/browse/ZBX-12567

0 commit comments

Comments
 (0)