Skip to content

Commit

Permalink
Merge pull request #548 from Lord-Y/master
Browse files Browse the repository at this point in the history
Add Zabbix 4.0 compatibility
  • Loading branch information
bastelfreak authored Oct 14, 2018
2 parents b1e5c62 + b3d6438 commit dea2ef4
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
4 changes: 2 additions & 2 deletions manifests/database/mysql.pp
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
assert_private()

#
# Adjustments for version 3.0 - structure of package with sqls differs from previous versions
# Adjustments for version 3.0/4.0 - structure of package with sqls differs from previous versions
case $zabbix_version {
/^3.\d+$/: {
/^(3|4).\d+$/: {
if ($database_schema_path == false) or ($database_schema_path == '') {
$schema_path = '/usr/share/doc/zabbix-*-mysql*'
}
Expand Down
4 changes: 2 additions & 2 deletions manifests/database/postgresql.pp
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
assert_private()

#
# Adjustments for version 3.0 - structure of package with sqls differs from previous versions
# Adjustments for version 3.0/4.0 - structure of package with sqls differs from previous versions
case $zabbix_version {
/^3.\d+$/: {
/^(3|4).\d+$/: {
if ($database_schema_path == false) or ($database_schema_path == '') {
case $facts['os']['name'] {
'CentOS', 'RedHat', 'OracleLinux': {
Expand Down
9 changes: 7 additions & 2 deletions manifests/userparameters.pp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
# When 'script' is used, this parameter can provide the directly where this script needs to
# be placed. Default: '/usr/bin'
#
# [*config_mode*]
# When 'config_mode' is used, this parameter can provide the mode of the config file who will be created
# to keep some credidentials private. Default: '0644'
#
# === Example
#
# zabbix::userparameters { 'mysql':
Expand Down Expand Up @@ -59,6 +63,7 @@
$script_ext = '',
$template = '',
$script_dir = '/usr/bin',
$config_mode = '0644',
) {
$include_dir = getvar('::zabbix::agent::include_dir')
$zabbix_package_agent = getvar('::zabbix::agent::zabbix_package_agent')
Expand All @@ -70,7 +75,7 @@
ensure => present,
owner => $agent_config_owner,
group => $agent_config_group,
mode => '0644',
mode => $config_mode,
source => $source,
notify => Service['zabbix-agent'],
require => Package[$zabbix_package_agent],
Expand All @@ -82,7 +87,7 @@
ensure => present,
owner => $agent_config_owner,
group => $agent_config_group,
mode => '0644',
mode => $config_mode,
content => $content,
notify => Service['zabbix-agent'],
require => Package[$zabbix_package_agent],
Expand Down
2 changes: 1 addition & 1 deletion spec/acceptance/agent_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'spec_helper_acceptance'

['2.4', '3.2', '3.4'].each do |version|
['2.4', '3.2', '3.4', '4.0'].each do |version|
if version == '2.4' && default[:platform] =~ %r{(ubuntu-16.04-amd64|debian-8-amd64)}
next
end
Expand Down

0 comments on commit dea2ef4

Please sign in to comment.