diff --git a/.travis.yml b/.travis.yml index bf1652da6..7fe2c531e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,9 +10,10 @@ 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 - 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 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" diff --git a/manifests/agent.pp b/manifests/agent.pp index e7e9d230f..701dd15d2 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'], } @@ -315,7 +319,7 @@ enable => true, hasstatus => true, hasrestart => true, - require => Package['zabbix-agent'], + require => Package[$zabbix_package_agent], } # Configuring the zabbix-agent configuration file @@ -325,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'), } diff --git a/manifests/params.pp b/manifests/params.pp index 5dc42a7d4..32ca90f5b 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -13,23 +13,30 @@ class zabbix::params { # It seems that ubuntu has an different fping path... case $::operatingsystem { - 'ubuntu' : { + 'ubuntu', 'debian' : { $server_fpinglocation = '/usr/bin/fping' $server_fping6location = '/usr/bin/fping6' $proxy_fpinglocation = '/usr/bin/fping' $proxy_fping6location = '/usr/bin/fping6' + $manage_repo = true + $zabbix_package_agent = 'zabbix-agent' } - 'debian' : { + 'Archlinux': { $server_fpinglocation = '/usr/bin/fping' $server_fping6location = '/usr/bin/fping6' $proxy_fpinglocation = '/usr/bin/fping' $proxy_fping6location = '/usr/bin/fping6' + $manage_repo = false + $zabbix_package_agent = 'zabbix3-agent' + } default : { $server_fpinglocation = '/usr/sbin/fping' $server_fping6location = '/usr/sbin/fping6' $proxy_fpinglocation = '/usr/sbin/fping' $proxy_fping6location = '/usr/sbin/fping6' + $manage_repo = true + $zabbix_package_agent = 'zabbix-agent' } } @@ -47,7 +54,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 diff --git a/manifests/userparameters.pp b/manifests/userparameters.pp index fc33ca81a..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 @@ -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], } }