Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set selboolean for zabbix proxy #235

Merged
merged 4 commits into from
Jun 3, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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