Skip to content

Commit

Permalink
Merge pull request #201 from bastelfreak/add-archlinux
Browse files Browse the repository at this point in the history
[WIP]Add archlinux
  • Loading branch information
ericsysmin committed Apr 8, 2016
2 parents 10cb3dc + 4929bc1 commit 3bd3060
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 13 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
10 changes: 7 additions & 3 deletions manifests/agent.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
#
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -304,7 +308,7 @@
}

# Installing the package
package { 'zabbix-agent':
package { $zabbix_package_agent:
ensure => $zabbix_package_state,
require => Class['zabbix::repo'],
}
Expand All @@ -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
Expand All @@ -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'),
}
Expand Down
12 changes: 9 additions & 3 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
}

Expand All @@ -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
Expand Down
11 changes: 6 additions & 5 deletions manifests/userparameters.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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":
Expand All @@ -70,7 +71,7 @@
mode => '0644',
source => $source,
notify => Service['zabbix-agent'],
require => Package['zabbix-agent'],
require => Package[$zabbix_agent_package],
}
}

Expand All @@ -82,7 +83,7 @@
mode => '0644',
content => $content,
notify => Service['zabbix-agent'],
require => Package['zabbix-agent'],
require => Package[$zabbix_agent_package],
}
}

Expand All @@ -94,7 +95,7 @@
mode => '0755',
source => $script,
notify => Service['zabbix-agent'],
require => Package['zabbix-agent'],
require => Package[$zabbix_agent_package],
}
}

Expand Down

0 comments on commit 3bd3060

Please sign in to comment.