From aff18be92591de1eb728c98158c5c63ea2001379 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Thu, 7 Apr 2016 17:05:24 +0200 Subject: [PATCH 01/11] introduce Arch block, move $manage_repo into it --- manifests/params.pp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/manifests/params.pp b/manifests/params.pp index 5dc42a7d4..d864ee237 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -18,12 +18,17 @@ $server_fping6location = '/usr/bin/fping6' $proxy_fpinglocation = '/usr/bin/fping' $proxy_fping6location = '/usr/bin/fping6' + $manage_repo = true } 'debian' : { $server_fpinglocation = '/usr/bin/fping' $server_fping6location = '/usr/bin/fping6' $proxy_fpinglocation = '/usr/bin/fping' $proxy_fping6location = '/usr/bin/fping6' + $manage_repo = true + } + 'Archlinux': { + $manage_repo = false } default : { $server_fpinglocation = '/usr/sbin/fping' @@ -47,7 +52,6 @@ $zabbix_web_ip = '127.0.0.1' $manage_database = true $manage_firewall = false - $manage_repo = true $repo_location = '' $manage_resources = false $manage_vhost = true From 2555cf22fbee19ecc370a92347f1b6854ea3ebf2 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Thu, 7 Apr 2016 17:08:16 +0200 Subject: [PATCH 02/11] add multiple fping vars to Arch --- manifests/params.pp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/manifests/params.pp b/manifests/params.pp index d864ee237..c91eda5c4 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -28,7 +28,12 @@ $manage_repo = true } 'Archlinux': { + $server_fpinglocation = '/usr/bin/fping' + $server_fping6location = '/usr/bin/fping6' + $proxy_fpinglocation = '/usr/bin/fping' + $proxy_fping6location = '/usr/bin/fping6' $manage_repo = false + } default : { $server_fpinglocation = '/usr/sbin/fping' From 1ae6809a45324f3b9712b5a5d484be89cbc606a8 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Thu, 7 Apr 2016 17:09:10 +0200 Subject: [PATCH 03/11] combine Ubuntu and Debian block --- manifests/params.pp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/manifests/params.pp b/manifests/params.pp index c91eda5c4..b1e6cbbde 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -13,14 +13,7 @@ class zabbix::params { # It seems that ubuntu has an different fping path... case $::operatingsystem { - 'ubuntu' : { - $server_fpinglocation = '/usr/bin/fping' - $server_fping6location = '/usr/bin/fping6' - $proxy_fpinglocation = '/usr/bin/fping' - $proxy_fping6location = '/usr/bin/fping6' - $manage_repo = true - } - 'debian' : { + 'ubuntu', 'debian' : { $server_fpinglocation = '/usr/bin/fping' $server_fping6location = '/usr/bin/fping6' $proxy_fpinglocation = '/usr/bin/fping' From 827db9cb39280aebc99a723295f80f3eb91a12c3 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Fri, 8 Apr 2016 11:23:18 +0200 Subject: [PATCH 04/11] implement zabbix_package_agent we need a solution to differ between the different package names on the different platforms (agent.pp). I also update the default params so that they work on every platform with sane defaults. --- manifests/agent.pp | 6 +++++- manifests/params.pp | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/manifests/agent.pp b/manifests/agent.pp index e7e9d230f..83097b2c8 100644 --- a/manifests/agent.pp +++ b/manifests/agent.pp @@ -18,6 +18,9 @@ # The state of the package that needs to be installed: present or latest. # Default: present # +# [*zabbix_package_agent*] +# The name of the agent package that we manage +# # [*manage_firewall*] # When true, it will create iptables rules. # @@ -200,6 +203,7 @@ class zabbix::agent ( $zabbix_version = $zabbix::params::zabbix_version, $zabbix_package_state = $zabbix::params::zabbix_package_state, + $zabbix_package_agent = $zabbix::params::zabbix_package_agent, $manage_firewall = $zabbix::params::manage_firewall, $manage_repo = $zabbix::params::manage_repo, $manage_resources = $zabbix::params::manage_resources, @@ -304,7 +308,7 @@ } # Installing the package - package { 'zabbix-agent': + package { $zabbix_package_agent: ensure => $zabbix_package_state, require => Class['zabbix::repo'], } diff --git a/manifests/params.pp b/manifests/params.pp index b1e6cbbde..d7f49f619 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -19,6 +19,7 @@ $proxy_fpinglocation = '/usr/bin/fping' $proxy_fping6location = '/usr/bin/fping6' $manage_repo = true + $zabbix_package_agent = 'zabbix-agent' } 'Archlinux': { $server_fpinglocation = '/usr/bin/fping' @@ -26,6 +27,7 @@ $proxy_fpinglocation = '/usr/bin/fping' $proxy_fping6location = '/usr/bin/fping6' $manage_repo = false + $zabbix_package_agent = 'zabbix3-agent' } default : { @@ -33,6 +35,7 @@ $server_fping6location = '/usr/sbin/fping6' $proxy_fpinglocation = '/usr/sbin/fping' $proxy_fping6location = '/usr/sbin/fping6' + $zabbix_package_agent = 'zabbix-agent' } } From 5dba4c4a49c20aa63f748c6e5c089347e85cbace Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Fri, 8 Apr 2016 11:36:03 +0200 Subject: [PATCH 05/11] update references to the agent package resource --- manifests/agent.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/agent.pp b/manifests/agent.pp index 83097b2c8..701dd15d2 100644 --- a/manifests/agent.pp +++ b/manifests/agent.pp @@ -319,7 +319,7 @@ enable => true, hasstatus => true, hasrestart => true, - require => Package['zabbix-agent'], + require => Package[$zabbix_package_agent], } # Configuring the zabbix-agent configuration file @@ -329,7 +329,7 @@ group => 'zabbix', mode => '0644', notify => Service['zabbix-agent'], - require => Package['zabbix-agent'], + require => Package[$zabbix_package_agent], replace => true, content => template('zabbix/zabbix_agentd.conf.erb'), } From bd47ea36b91394e2e835d98a8743f0270ecbf52e Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Fri, 8 Apr 2016 11:41:11 +0200 Subject: [PATCH 06/11] replace hardcoded package name with var --- manifests/userparameters.pp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/manifests/userparameters.pp b/manifests/userparameters.pp index fc33ca81a..2aa49d65c 100644 --- a/manifests/userparameters.pp +++ b/manifests/userparameters.pp @@ -60,7 +60,8 @@ $template = '', $script_dir = '/usr/bin', ) { - $include_dir = $zabbix::agent::include_dir + $include_dir = $zabbix::agent::include_dir + $zabbix_agent_package = $zabbix::params::zabbix_agent_package if $source != '' { file { "${include_dir}/${name}.conf": @@ -70,7 +71,7 @@ mode => '0644', source => $source, notify => Service['zabbix-agent'], - require => Package['zabbix-agent'], + require => Package[$zabbix_agent_package], } } @@ -82,7 +83,7 @@ mode => '0644', content => $content, notify => Service['zabbix-agent'], - require => Package['zabbix-agent'], + require => Package[$zabbix_agent_package], } } @@ -94,7 +95,7 @@ mode => '0755', source => $script, notify => Service['zabbix-agent'], - require => Package['zabbix-agent'], + require => Package[$zabbix_agent_package], } } From 469ba6c227dd3a0d45ff602875e5112d31c5c0f4 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Fri, 8 Apr 2016 11:41:36 +0200 Subject: [PATCH 07/11] remove trailing whitespace --- manifests/userparameters.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/userparameters.pp b/manifests/userparameters.pp index 2aa49d65c..1987d555c 100644 --- a/manifests/userparameters.pp +++ b/manifests/userparameters.pp @@ -25,7 +25,7 @@ # 'source' which you add. The template will be added to the host. # # [*script_dir*] -# When 'script' is used, this parameter can provide the directly where this script needs to +# When 'script' is used, this parameter can provide the directly where this script needs to # be placed. Default: '/usr/bin' # # === Example From 4a355c9edd91a3d82704e6cfdfec99b8960ff5e1 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Fri, 8 Apr 2016 14:07:27 +0200 Subject: [PATCH 08/11] extend travis matrix with a job without strict var --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index bf1652da6..f3f5aac90 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,3 +16,4 @@ env: - PUPPET_GEM_VERSION="~> 3.0" STRICT_VARIABLES=yes - PUPPET_GEM_VERSION="~> 3.0" STRICT_VARIABLES=yes FUTURE_PARSER=yes - PUPPET_GEM_VERSION="~> 4.0" STRICT_VARIABLES=yes + - PUPPET_GEM_VERSION="~> 3.0" FUTURE_PARSER=yes From 33000ad8e9b8cd7433181541f8f7853f0a179b9a Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Fri, 8 Apr 2016 14:53:31 +0200 Subject: [PATCH 09/11] add missing default value for manage_repo --- manifests/params.pp | 1 + 1 file changed, 1 insertion(+) diff --git a/manifests/params.pp b/manifests/params.pp index d7f49f619..32ca90f5b 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -35,6 +35,7 @@ $server_fping6location = '/usr/sbin/fping6' $proxy_fpinglocation = '/usr/sbin/fping' $proxy_fping6location = '/usr/sbin/fping6' + $manage_repo = true $zabbix_package_agent = 'zabbix-agent' } } From a185c023d5afdfe524b42faf533abcd0ab9baabe Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Fri, 8 Apr 2016 14:55:21 +0200 Subject: [PATCH 10/11] bin rspec-puppet to 2.3.3 the current one, 2.4.0 is broken :( --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index dba3b7714..266c743a2 100644 --- a/Gemfile +++ b/Gemfile @@ -4,7 +4,7 @@ group :test do gem "rake" gem "puppet", ENV['PUPPET_GEM_VERSION'] || '~> 4.0' gem "rspec", '< 3.2.0' - gem "rspec-puppet" + gem "rspec-puppet", '2.3.2' gem "puppetlabs_spec_helper" gem "metadata-json-lint" gem "rspec-puppet-facts" From 4929bc12e49c80f21b13b6fad0833951d4046d6f Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Fri, 8 Apr 2016 14:57:11 +0200 Subject: [PATCH 11/11] bump ruby 2.1 to latest 2.1.9 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f3f5aac90..7fe2c531e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,7 @@ bundler_args: --without development system_tests before_install: rm Gemfile.lock || true rvm: - 1.9.3 - - 2.1.0 + - 2.1.8 script: "bundle exec rake test" env: - PUPPET_GEM_VERSION="~> 3.0" STRICT_VARIABLES=yes