diff --git a/manifests/database/mysql.pp b/manifests/database/mysql.pp index 1fa9f9e82..46a1e0f00 100644 --- a/manifests/database/mysql.pp +++ b/manifests/database/mysql.pp @@ -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*' } diff --git a/manifests/database/postgresql.pp b/manifests/database/postgresql.pp index def215512..5ccdc91da 100644 --- a/manifests/database/postgresql.pp +++ b/manifests/database/postgresql.pp @@ -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': { diff --git a/manifests/userparameters.pp b/manifests/userparameters.pp index 591b010fc..6906143da 100644 --- a/manifests/userparameters.pp +++ b/manifests/userparameters.pp @@ -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': @@ -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') @@ -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], @@ -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], diff --git a/spec/acceptance/agent_spec.rb b/spec/acceptance/agent_spec.rb index 769cee531..ffe00d9d3 100644 --- a/spec/acceptance/agent_spec.rb +++ b/spec/acceptance/agent_spec.rb @@ -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