Skip to content

Commit

Permalink
Set selboolean for zabbix proxy (#235)
Browse files Browse the repository at this point in the history
* Set selboolean for zabbix proxy
  • Loading branch information
sgnl05 authored and bastelfreak committed Jun 3, 2016
1 parent 4f44393 commit 57d7b54
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
9 changes: 9 additions & 0 deletions manifests/proxy.pp
Original file line number Diff line number Diff line change
Expand Up @@ -601,4 +601,13 @@
'ESTABLISHED'],
}
}

# check if selinux is active and allow zabbix
if $::osfamily == 'RedHat' and $::selinux_config_mode == 'enforcing' {
selboolean{'zabbix_can_network':
persistent => true,
value => 'on',
}
}

}
10 changes: 9 additions & 1 deletion spec/classes/proxy_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
lsbdistcodename: '',
id: 'root',
kernel: 'Linux',
path: '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/sbin'
path: '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/sbin',
selinux_config_mode: ''
}
end

Expand Down Expand Up @@ -64,6 +65,13 @@
it { should contain_package('zabbix-proxy').with_ensure('present') }
end

describe 'with enabled selinux' do
let :facts do
super().merge(selinux_config_mode: 'enforcing')
end
it { should contain_selboolean('zabbix_can_network').with('value' => 'on', 'persistent' => true) }
end

describe 'when database_type is postgresql' do
let :params do
{
Expand Down

0 comments on commit 57d7b54

Please sign in to comment.