Skip to content

Commit

Permalink
Merge pull request #289 from yevtushenko/adapt_to_3.2
Browse files Browse the repository at this point in the history
Adapt to zabbix-3.2 and higher.
  • Loading branch information
bastelfreak authored Oct 13, 2016
2 parents f245992 + e8f8f06 commit 2974741
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 5 deletions.
2 changes: 1 addition & 1 deletion manifests/database/mysql.pp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#
# Adjustments for version 3.0 - structure of package with sqls differs from previous versions
case $zabbix_version {
'3.0': {
/^3.\d+$/: {
if ($database_schema_path == false) or ($database_schema_path == '') {
$schema_path = '/usr/share/doc/zabbix-*-mysql*'
}
Expand Down
2 changes: 1 addition & 1 deletion manifests/database/postgresql.pp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#
# Adjustments for version 3.0 - structure of package with sqls differs from previous versions
case $zabbix_version {
'3.0': {
/^3.\d+$/: {
if ($database_schema_path == false) or ($database_schema_path == '') {
case $::operatingsystem {
'CentOS', 'RedHat', 'OracleLinux': {
Expand Down
16 changes: 16 additions & 0 deletions spec/classes/server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,22 @@
}
end

it { should contain_file('/etc/zabbix/zabbix_server.conf').with_content %r{^TLSCAFile=/etc/zabbix/keys/zabbix-server.ca$} }
it { should contain_file('/etc/zabbix/zabbix_server.conf').with_content %r{^TLSCRLFile=/etc/zabbix/keys/zabbix-server.crl$} }
it { should contain_file('/etc/zabbix/zabbix_server.conf').with_content %r{^TLSCertFile=/etc/zabbix/keys/zabbix-server.crt$} }
it { should contain_file('/etc/zabbix/zabbix_server.conf').with_content %r{^TLSKeyFile=/etc/zabbix/keys/zabbix-server.key$} }
end
context 'with zabbix_server.conf and version 3.2' do
let :params do
{
tlscafile: '/etc/zabbix/keys/zabbix-server.ca',
tlscrlfile: '/etc/zabbix/keys/zabbix-server.crl',
tlscertfile: '/etc/zabbix/keys/zabbix-server.crt',
tlskeyfile: '/etc/zabbix/keys/zabbix-server.key',
zabbix_version: '3.2'
}
end

it { should contain_file('/etc/zabbix/zabbix_server.conf').with_content %r{^TLSCAFile=/etc/zabbix/keys/zabbix-server.ca$} }
it { should contain_file('/etc/zabbix/zabbix_server.conf').with_content %r{^TLSCRLFile=/etc/zabbix/keys/zabbix-server.crl$} }
it { should contain_file('/etc/zabbix/zabbix_server.conf').with_content %r{^TLSCertFile=/etc/zabbix/keys/zabbix-server.crt$} }
Expand Down
2 changes: 1 addition & 1 deletion templates/zabbix_agentd.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ LoadModulePath=<%= @loadmodulepath %>
#
<% if @loadmodule %>LoadModule=<%= @loadmodule %><% end %>
<% if @zabbix_version == '3.0' %>
<% if @zabbix_version.to_f >= 3.0 %>
####### TLS-RELATED PARAMETERS #######

### Option: TLSConnect
Expand Down
2 changes: 1 addition & 1 deletion templates/zabbix_proxy.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ LoadModulePath=<%= @loadmodulepath %>
<% if @loadmodule %>LoadModule=<%= @loadmodule %><% end %>
<% if @zabbix_version == '3.0' %>
<% if @zabbix_version.to_f >= 3.0 %>
####### TLS-RELATED PARAMETERS #######

### Option: TLSConnect
Expand Down
2 changes: 1 addition & 1 deletion templates/zabbix_server.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ LoadModulePath=<%= @loadmodulepath %>
#
<% if @loadmodule %>LoadModule = <%= @loadmodule %><% end %>
<% if @zabbix_version == '3.0' %>
<% if @zabbix_version.to_f >= 3.0 %>
####### TLS-RELATED PARAMETERS #######

### Option: TLSCAFile
Expand Down

0 comments on commit 2974741

Please sign in to comment.