Skip to content
This repository was archived by the owner on Nov 27, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .fixtures.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
fixtures:
repositories:
stdlib: git://github.com/puppetlabs/puppetlabs-stdlib.git
symlinks:
icinga: "#{source_dir}"
6 changes: 2 additions & 4 deletions Gemfile → .gemfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
source :rubygems

puppetversion = ENV.key?('PUPPET_VERSION') ? "= #{ENV['PUPPET_VERSION']}" : ['>= 2.7']

gem 'rake'
gem 'puppet-lint'
gem 'rspec-puppet'
gem 'puppet', puppetversion
gem 'puppetlabs_spec_helper', '>= 0.1.0'
gem 'puppet-lint'
12 changes: 8 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
language: ruby
rvm:
- 1.8.7
- 1.9.3
before_script:
after_script:
script: "rake spec"
branches:
only:
- master
env:
- PUPPET_VERSION=2.6.1
- PUPPET_VERSION=2.6.2
- PUPPET_VERSION=2.6.4
- PUPPET_VERSION=2.7.1
- PUPPET_VERSION=2.7.14
- PUPPET_VERSION=2.7.11
- PUPPET_VERSION=2.7.18
- PUPPET_VERSION=3.0.1
notifications:
email: [email protected]
gemfile: .gemfile
339 changes: 339 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

32 changes: 5 additions & 27 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,27 +1,5 @@
require 'rake'
require 'rspec/core/rake_task'

task :default => [:spec, :lint]

desc "Run all module spec tests"
RSpec::Core::RakeTask.new(:spec) do |t|
t.rspec_opts = ['--color']
t.pattern = 'spec/{classes,defines,unit}/**/*_spec.rb'
end

desc "Build puppet module package"
task :build do
begin
Gem::Specification.find_by_name('puppet-module')
rescue Gem::LoadError, NoMethodError
require 'puppet/face'
pmod = Puppet::Face['module', :current]
pmod.build('./')
end
end

desc "Check puppet manifests with puppet-lint"
task :lint do
system("puppet-lint --with-filename --no-80chars-check manifests")
system("puppet-lint --with-filename --no-80chars-check tests")
end
require 'rubygems'
require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-lint/tasks/puppet-lint'
PuppetLint.configuration.send("disable_80chars")
PuppetLint.configuration.ignore_paths = ["spec/fixtures/**/*.pp"]
8 changes: 4 additions & 4 deletions manifests/master.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
include icinga::service

exec { 'external-commands':
command => 'dpkg-statoverride --update --add nagios nagios 751 /var/lib/icinga && dpkg-statoverride --update --add nagios www-data 2710 /var/lib/icinga/rw',
unless => 'dpkg-statoverride --list nagios nagios 751 /var/lib/icinga && dpkg-statoverride --list nagios www-data 2710 /var/lib/icinga/rw',
command => '/usr/sbin/dpkg-statoverride --update --add nagios nagios 751 /var/lib/icinga && dpkg-statoverride --update --add nagios www-data 2710 /var/lib/icinga/rw',
unless => '/usr/sbin/dpkg-statoverride --list nagios nagios 751 /var/lib/icinga && dpkg-statoverride --list nagios www-data 2710 /var/lib/icinga/rw',
notify => Service['icinga'],
}

# Bug: 3299
exec { 'fix-permissions':
command => 'chmod -R go+r /etc/icinga/objects',
command => '/bin/chmod -R go+r /etc/icinga/objects',
refreshonly => true,
notify => Service['icinga'],
}
Expand Down Expand Up @@ -142,4 +142,4 @@
],
}
}
}
}
11 changes: 6 additions & 5 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@
"summary": "Icinga Module",
"version": "0.0.27",
"checksums": {
".project": "e9a62b42390c6965a1e7dd2a83d8d322",
".travis.yml": "c4089256774e5cb9094e91a3fe1c2780",
"Gemfile": "d5ce5c80f3c31e583507eb80b61b7400",
".fixtures.yml": "12c32ab16b6adb2a50c2d8202a46126f",
".gemfile": "73cc3f47b89e2b1dbde81dd5cb35d230",
".travis.yml": "42dc25c6f766b53cbe7cbe8c5a293561",
"LICENSE": "b234ee4d69f5fce4486a80fdaf4a4263",
"Modulefile": "d4dbe54e402d8e8774de2fc1dbe068fe",
"README": "0d054da72567eeaec961a4051cd57848",
"Rakefile": "17e38802c4cef92b76ce3c00b9e339ec",
"Rakefile": "6c0454b5f83810523ed776de5afd1fe6",
"examples/icinga.yaml": "72c4d51e95381b913a7a97625c939c72",
"files/common/etc/icinga/objects/generic-contact.cfg": "90472bfed87fb11c737ec6e6dd849334",
"files/common/etc/icinga/objects/generic-host.cfg": "777986a830da33f2e19c05aaa1b3a15b",
Expand Down Expand Up @@ -68,7 +69,7 @@
"manifests/service/services.pp": "c9d77bbe45825fab0abd8fe8207b4c67",
"manifests/whitelist.pp": "d4252ed522ad2f2bf09a6fec23be2f0d",
"spec/spec.opts": "a600ded995d948e393fbe2320ba8e51c",
"spec/spec_helper.rb": "ca19ec4f451ebc7fdb035b52eae6e909",
"spec/spec_helper.rb": "3ea886dd135e120afa31e0aab12e85b0",
"templates/common/etc/icinga/htpasswd.users.erb": "508a69aa1bedc852df661a928970e669",
"templates/common/etc/nagios/nrpe.cfg.erb": "1a80b5a5362a54b24e23b330cc173bb4",
"tests/init.pp": "e871d9ed4962c385f4f290d198c32fdb"
Expand Down
2 changes: 2 additions & 0 deletions spec/fixtures/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!.gitignore
20 changes: 2 additions & 18 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,18 +1,2 @@
require 'pathname'
dir = Pathname.new(__FILE__).parent
$LOAD_PATH.unshift(dir, dir + 'lib', dir + '../lib')

require 'mocha'
require 'puppet'
gem 'rspec', '=1.2.9'
require 'spec/autorun'

Spec::Runner.configure do |config|
config.mock_with :mocha
end

# We need this because the RAL uses 'should' as a method. This
# allows us the same behaviour but with a different method name.
class Object
alias :must :should
end
require 'rubygems'
require 'puppetlabs_spec_helper/module_spec_helper'
2 changes: 1 addition & 1 deletion templates/common/etc/icinga/htpasswd.users.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#

<% Puppet::Parser::Functions.function('hiera') -%>
<% htpasswd = scope.function_hiera('htpasswd') -%>
<% htpasswd = scope.function_hiera(['htpasswd']) -%>
<% htpasswd.each do |key,value| -%>
<%= key -%>:<%= value %>
<% end -%>
2 changes: 1 addition & 1 deletion templates/common/etc/nagios/nrpe.cfg.erb
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ nrpe_group=nagios
<% if t_whitelist.length > 1 -%>
allowed_hosts=<%= t_whitelist.join(",") %>
<% else -%>
allowed_hosts=<%= t_whitelist %>
allowed_hosts=<%= t_whitelist[0] %>
<% end -%>


Expand Down