Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
398 additions
and
158 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
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
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#! /usr/bin/env ruby -S rspec | ||
require 'spec_helper_acceptance' | ||
|
||
describe 'icingaweb2 with apache2' do | ||
it 'with basic settings and apache2' do | ||
pp = " | ||
class { 'apache': | ||
mpm_module => 'prefork' | ||
} | ||
class { 'apache::mod::php': } | ||
case $::osfamily { | ||
'redhat': { | ||
package { 'php-mysql': } | ||
file {'/etc/httpd/conf.d/icingaweb2.conf': | ||
source => 'puppet:///modules/icingaweb2/examples/apache2/icingaweb2.conf', | ||
require => Class['apache'], | ||
notify => Service['httpd'], | ||
} | ||
} | ||
'debian': { | ||
class { 'apache::mod::rewrite': } | ||
file {'/etc/apache2/conf.d/icingaweb2.conf': | ||
source => 'puppet:///modules/icingaweb2/examples/apache2/icingaweb2.conf', | ||
require => Class['apache'], | ||
notify => Service['apache2'], | ||
} | ||
} | ||
} | ||
class {'icingaweb2': | ||
manage_repo => true, | ||
} | ||
" | ||
|
||
apply_manifest(pp, catch_failures: true) | ||
end | ||
|
||
if fact('osfamily') == 'Debian' | ||
describe service('apache2') do | ||
it { is_expected.to be_running } | ||
end | ||
end | ||
|
||
if fact('osfamily') == 'RedHat' | ||
describe service('httpd') do | ||
it { is_expected.to be_running } | ||
end | ||
end | ||
|
||
describe command('curl -I http://localhost/icingaweb2/') do | ||
its(:stdout) { should match(%r{302 Found}) } | ||
end | ||
end |
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#! /usr/bin/env ruby -S rspec | ||
require 'spec_helper_acceptance' | ||
|
||
describe 'icingaweb2 class:' do | ||
it 'runs successfully' do | ||
pp = " | ||
class { '::icingaweb2': | ||
manage_repo => true, | ||
} | ||
" | ||
|
||
apply_manifest(pp, catch_failures: true) | ||
end | ||
|
||
describe package('icingaweb2') do | ||
it { is_expected.to be_installed } | ||
end | ||
|
||
describe file('/etc/icingaweb2/config.ini') do | ||
it { is_expected.to be_file } | ||
it { is_expected.to contain '[global]' } | ||
it { is_expected.to contain '[logging]' } | ||
end | ||
|
||
end |
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 |
---|---|---|
@@ -0,0 +1,95 @@ | ||
#! /usr/bin/env ruby -S rspec | ||
require 'spec_helper_acceptance' | ||
|
||
describe 'icingaweb2::module::director class:' do | ||
it 'runs successfully' do | ||
pp = " | ||
package { 'git': } | ||
include ::mysql::server | ||
mysql::db { 'icingaweb2': | ||
user => 'icingaweb2', | ||
password => 'icingaweb2', | ||
host => 'localhost', | ||
grant => ['SELECT', 'INSERT', 'UPDATE', 'DELETE', 'DROP', 'CREATE VIEW', 'CREATE', 'INDEX', 'EXECUTE', 'ALTER', 'REFERENCES'], | ||
} | ||
mysql::db { 'director': | ||
user => 'director', | ||
password => 'director', | ||
host => 'localhost', | ||
charset => 'utf8', | ||
grant => ['SELECT', 'INSERT', 'UPDATE', 'DELETE', 'DROP', 'CREATE VIEW', 'CREATE', 'INDEX', 'EXECUTE', 'ALTER', 'REFERENCES'], | ||
} | ||
class {'icingaweb2': | ||
manage_repo => true, | ||
import_schema => true, | ||
db_type => 'mysql', | ||
db_host => 'localhost', | ||
db_port => 3306, | ||
db_username => 'icingaweb2', | ||
db_password => 'icingaweb2', | ||
require => Mysql::Db['icingaweb2'], | ||
} | ||
class {'icingaweb2::module::monitoring': | ||
ido_host => 'localhost', | ||
ido_db_name => 'icinga2', | ||
ido_db_username => 'icinga2', | ||
ido_db_password => 'supersecret', | ||
commandtransports => { | ||
icinga2 => { | ||
transport => 'api', | ||
username => 'root', | ||
password => 'icinga', | ||
} | ||
} | ||
} | ||
class {'icingaweb2::module::director': | ||
git_revision => 'v1.3.2', | ||
db_host => 'localhost', | ||
db_name => 'director', | ||
db_username => 'director', | ||
db_password => 'director', | ||
import_schema => true, | ||
kickstart => false, | ||
endpoint => 'puppet-icingaweb2.localdomain', | ||
api_username => 'root', | ||
api_password => 'icinga', | ||
require => Mysql::Db['director'] | ||
} | ||
" | ||
|
||
apply_manifest(pp, catch_failures: true) | ||
end | ||
|
||
describe file('/etc/icingaweb2/enabledModules/director') do | ||
it { is_expected.to be_symlink } | ||
end | ||
|
||
describe file('/etc/icingaweb2/modules/director/config.ini') do | ||
it { is_expected.to be_file } | ||
it { is_expected.to contain '[db]' } | ||
it { is_expected.to contain 'resource = "icingaweb2-module-director"' } | ||
end | ||
|
||
describe file('/etc/icingaweb2/resources.ini') do | ||
it { is_expected.to be_file } | ||
it { is_expected.to contain '[icingaweb2-module-director]' } | ||
it { is_expected.to contain 'type = "db"' } | ||
it { is_expected.to contain 'db = "mysql"' } | ||
it { is_expected.to contain 'host = "localhost"' } | ||
it { is_expected.to contain 'port = "3306"' } | ||
it { is_expected.to contain 'dbname = "director"' } | ||
it { is_expected.to contain 'username = "director"' } | ||
it { is_expected.to contain 'password = "director"' } | ||
it { is_expected.to contain 'charset = "utf8"' } | ||
end | ||
|
||
#describe command('mysql -e "select object_name from director.icinga_apiuser"') do | ||
# its(:stdout) { should match(%r{root}) } | ||
#end | ||
end |
Oops, something went wrong.