forked from voxpupuli/puppet-icinga2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes voxpupuli#207
- Loading branch information
Showing
13 changed files
with
277 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,53 @@ | ||
node /(debian|rhel|ubuntu|sles|oracle)/ { | ||
class { '::icinga2': | ||
manage_repo => true, | ||
} | ||
node default { | ||
package { 'curl': } | ||
|
||
class { '::icinga2::pki::ca': } | ||
case $::kernel { | ||
'linux': { | ||
$manage_repo = true | ||
$target_dir = '/etc/icinga2/conf.d' | ||
} # linux | ||
|
||
'windows': { | ||
$manage_repo = false | ||
$target_dir = 'C:/ProgramData/icinga2/etc/icinga2/conf.d' | ||
} # windows | ||
|
||
'FreeBSD': { | ||
$manage_repo = false | ||
$target_dir = '/usr/local/etc/icinga2/conf.d' | ||
} # FreeBSD | ||
} | ||
|
||
class { '::icinga2::feature::api': | ||
pki => 'none', | ||
class { '::icinga2': | ||
manage_repo => $manage_repo, | ||
} | ||
|
||
icinga2::object::apiuser { 'icinga': | ||
target => '/etc/icinga2/conf.d/apiuser.conf', | ||
target => "${target_dir}/apiuser.conf", | ||
password => 'icinga', | ||
permissions => [ "*" ], | ||
} | ||
|
||
package { 'curl': } | ||
} | ||
|
||
node /freebsd/ { | ||
class { '::icinga2': } | ||
|
||
class { '::icinga2::pki::ca': } | ||
|
||
class { '::icinga2::feature::api': | ||
pki => 'none', | ||
} | ||
|
||
icinga2::object::apiuser { 'icinga': | ||
target => '/usr/local/etc/icinga2/conf.d/apiuser.conf', | ||
password => 'icinga', | ||
permissions => [ "*" ], | ||
include ::mysql::server | ||
|
||
mysql::db { 'icinga2': | ||
user => 'icinga2', | ||
password => 'supersecret', | ||
host => 'localhost', | ||
grant => ['SELECT', 'INSERT', 'UPDATE', 'DELETE', 'DROP', 'CREATE VIEW', 'CREATE', 'INDEX', 'EXECUTE', 'ALTER'], | ||
} | ||
|
||
package { 'curl': } | ||
-> class{ '::icinga2::feature::idomysql': | ||
user => 'icinga2', | ||
password => 'supersecret', | ||
database => 'icinga2', | ||
import_schema => true, | ||
require => Mysql::Db['icinga2'], | ||
} | ||
} |
34 changes: 24 additions & 10 deletions
34
serverspec/spec/i2debian7puppet4/plattform_independent_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,32 @@ | ||
require 'spec_helper' | ||
|
||
describe package('icinga2') do | ||
it { should be_installed } | ||
end | ||
describe 'Basic Icinga 2 Installation' do | ||
context package('icinga2') do | ||
it { should be_installed } | ||
end | ||
|
||
describe service('icinga2') do | ||
it { should be_enabled } | ||
it { should be_running } | ||
context service('icinga2') do | ||
it { should be_enabled } | ||
it { should be_running } | ||
end | ||
end | ||
|
||
describe port(5665) do | ||
it { should be_listening.with('tcp') } | ||
describe 'API Feature' do | ||
context port(5665) do | ||
it { should be_listening.with('tcp') } | ||
end | ||
|
||
context command('curl -u icinga:icinga -k https://localhost:5665/v1') do | ||
its(:stdout) { should match(%r{Hello from Icinga 2}) } | ||
end | ||
end | ||
|
||
describe command('curl -u icinga:icinga -k https://localhost:5665/v1') do | ||
its(:stdout) { should match(%r{Hello from Icinga 2}) } | ||
describe 'MySQL IDO Feature' do | ||
context port(3306) do | ||
it { should be_listening.with('tcp') } | ||
end | ||
|
||
context command('mysql -e "select version from icinga_dbversion" icinga2') do | ||
its(:stdout) { should match(%r{version}) } | ||
end | ||
end |
34 changes: 24 additions & 10 deletions
34
serverspec/spec/i2debian8puppet4/plattform_independent_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,32 @@ | ||
require 'spec_helper' | ||
|
||
describe package('icinga2') do | ||
it { should be_installed } | ||
end | ||
describe 'Basic Icinga 2 Installation' do | ||
context package('icinga2') do | ||
it { should be_installed } | ||
end | ||
|
||
describe service('icinga2') do | ||
it { should be_enabled } | ||
it { should be_running } | ||
context service('icinga2') do | ||
it { should be_enabled } | ||
it { should be_running } | ||
end | ||
end | ||
|
||
describe port(5665) do | ||
it { should be_listening.with('tcp') } | ||
describe 'API Feature' do | ||
context port(5665) do | ||
it { should be_listening.with('tcp') } | ||
end | ||
|
||
context command('curl -u icinga:icinga -k https://localhost:5665/v1') do | ||
its(:stdout) { should match(%r{Hello from Icinga 2}) } | ||
end | ||
end | ||
|
||
describe command('curl -u icinga:icinga -k https://localhost:5665/v1') do | ||
its(:stdout) { should match(%r{Hello from Icinga 2}) } | ||
describe 'MySQL IDO Feature' do | ||
context port(3306) do | ||
it { should be_listening.with('tcp') } | ||
end | ||
|
||
context command('mysql -e "select version from icinga_dbversion" icinga2') do | ||
its(:stdout) { should match(%r{version}) } | ||
end | ||
end |
34 changes: 24 additions & 10 deletions
34
serverspec/spec/i2freebsd10puppet4/plattform_independent_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,32 @@ | ||
require 'spec_helper' | ||
|
||
describe package('icinga2') do | ||
it { should be_installed } | ||
end | ||
describe 'Basic Icinga 2 Installation' do | ||
context package('icinga2') do | ||
it { should be_installed } | ||
end | ||
|
||
describe service('icinga2') do | ||
it { should be_enabled } | ||
it { should be_running } | ||
context service('icinga2') do | ||
it { should be_enabled } | ||
it { should be_running } | ||
end | ||
end | ||
|
||
describe port(5665) do | ||
it { should be_listening.with('tcp') } | ||
describe 'API Feature' do | ||
context port(5665) do | ||
it { should be_listening.with('tcp') } | ||
end | ||
|
||
context command('curl -u icinga:icinga -k https://localhost:5665/v1') do | ||
its(:stdout) { should match(%r{Hello from Icinga 2}) } | ||
end | ||
end | ||
|
||
describe command('curl -u icinga:icinga -k https://localhost:5665/v1') do | ||
its(:stdout) { should match(%r{Hello from Icinga 2}) } | ||
describe 'MySQL IDO Feature' do | ||
context port(3306) do | ||
it { should be_listening.with('tcp') } | ||
end | ||
|
||
context command('mysql -e "select version from icinga_dbversion" icinga2') do | ||
its(:stdout) { should match(%r{version}) } | ||
end | ||
end |
34 changes: 24 additions & 10 deletions
34
serverspec/spec/i2freebsd11puppet4/plattform_independent_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,32 @@ | ||
require 'spec_helper' | ||
|
||
describe package('icinga2') do | ||
it { should be_installed } | ||
end | ||
describe 'Basic Icinga 2 Installation' do | ||
context package('icinga2') do | ||
it { should be_installed } | ||
end | ||
|
||
describe service('icinga2') do | ||
it { should be_enabled } | ||
it { should be_running } | ||
context service('icinga2') do | ||
it { should be_enabled } | ||
it { should be_running } | ||
end | ||
end | ||
|
||
describe port(5665) do | ||
it { should be_listening.with('tcp') } | ||
describe 'API Feature' do | ||
context port(5665) do | ||
it { should be_listening.with('tcp') } | ||
end | ||
|
||
context command('curl -u icinga:icinga -k https://localhost:5665/v1') do | ||
its(:stdout) { should match(%r{Hello from Icinga 2}) } | ||
end | ||
end | ||
|
||
describe command('curl -u icinga:icinga -k https://localhost:5665/v1') do | ||
its(:stdout) { should match(%r{Hello from Icinga 2}) } | ||
describe 'MySQL IDO Feature' do | ||
context port(3306) do | ||
it { should be_listening.with('tcp') } | ||
end | ||
|
||
context command('mysql -e "select version from icinga_dbversion" icinga2') do | ||
its(:stdout) { should match(%r{version}) } | ||
end | ||
end |
34 changes: 24 additions & 10 deletions
34
serverspec/spec/i2oracle7puppet4/plattform_independent_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,32 @@ | ||
require 'spec_helper' | ||
|
||
describe package('icinga2') do | ||
it { should be_installed } | ||
end | ||
describe 'Basic Icinga 2 Installation' do | ||
context package('icinga2') do | ||
it { should be_installed } | ||
end | ||
|
||
describe service('icinga2') do | ||
it { should be_enabled } | ||
it { should be_running } | ||
context service('icinga2') do | ||
it { should be_enabled } | ||
it { should be_running } | ||
end | ||
end | ||
|
||
describe port(5665) do | ||
it { should be_listening.with('tcp') } | ||
describe 'API Feature' do | ||
context port(5665) do | ||
it { should be_listening.with('tcp') } | ||
end | ||
|
||
context command('curl -u icinga:icinga -k https://localhost:5665/v1') do | ||
its(:stdout) { should match(%r{Hello from Icinga 2}) } | ||
end | ||
end | ||
|
||
describe command('curl -u icinga:icinga -k https://localhost:5665/v1') do | ||
its(:stdout) { should match(%r{Hello from Icinga 2}) } | ||
describe 'MySQL IDO Feature' do | ||
context port(3306) do | ||
it { should be_listening.with('tcp') } | ||
end | ||
|
||
context command('mysql -e "select version from icinga_dbversion" icinga2') do | ||
its(:stdout) { should match(%r{version}) } | ||
end | ||
end |
34 changes: 24 additions & 10 deletions
34
serverspec/spec/i2rhel6puppet4/plattform_independent_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,32 @@ | ||
require 'spec_helper' | ||
|
||
describe package('icinga2') do | ||
it { should be_installed } | ||
end | ||
describe 'Basic Icinga 2 Installation' do | ||
context package('icinga2') do | ||
it { should be_installed } | ||
end | ||
|
||
describe service('icinga2') do | ||
it { should be_enabled } | ||
it { should be_running } | ||
context service('icinga2') do | ||
it { should be_enabled } | ||
it { should be_running } | ||
end | ||
end | ||
|
||
describe port(5665) do | ||
it { should be_listening.with('tcp') } | ||
describe 'API Feature' do | ||
context port(5665) do | ||
it { should be_listening.with('tcp') } | ||
end | ||
|
||
context command('curl -u icinga:icinga -k https://localhost:5665/v1') do | ||
its(:stdout) { should match(%r{Hello from Icinga 2}) } | ||
end | ||
end | ||
|
||
describe command('curl -u icinga:icinga -k https://localhost:5665/v1') do | ||
its(:stdout) { should match(%r{Hello from Icinga 2}) } | ||
describe 'MySQL IDO Feature' do | ||
context port(3306) do | ||
it { should be_listening.with('tcp') } | ||
end | ||
|
||
context command('mysql -e "select version from icinga_dbversion" icinga2') do | ||
its(:stdout) { should match(%r{version}) } | ||
end | ||
end |
34 changes: 24 additions & 10 deletions
34
serverspec/spec/i2rhel7puppet4/plattform_independent_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,32 @@ | ||
require 'spec_helper' | ||
|
||
describe package('icinga2') do | ||
it { should be_installed } | ||
end | ||
describe 'Basic Icinga 2 Installation' do | ||
context package('icinga2') do | ||
it { should be_installed } | ||
end | ||
|
||
describe service('icinga2') do | ||
it { should be_enabled } | ||
it { should be_running } | ||
context service('icinga2') do | ||
it { should be_enabled } | ||
it { should be_running } | ||
end | ||
end | ||
|
||
describe port(5665) do | ||
it { should be_listening.with('tcp') } | ||
describe 'API Feature' do | ||
context port(5665) do | ||
it { should be_listening.with('tcp') } | ||
end | ||
|
||
context command('curl -u icinga:icinga -k https://localhost:5665/v1') do | ||
its(:stdout) { should match(%r{Hello from Icinga 2}) } | ||
end | ||
end | ||
|
||
describe command('curl -u icinga:icinga -k https://localhost:5665/v1') do | ||
its(:stdout) { should match(%r{Hello from Icinga 2}) } | ||
describe 'MySQL IDO Feature' do | ||
context port(3306) do | ||
it { should be_listening.with('tcp') } | ||
end | ||
|
||
context command('mysql -e "select version from icinga_dbversion" icinga2') do | ||
its(:stdout) { should match(%r{version}) } | ||
end | ||
end |
Oops, something went wrong.