Skip to content

Commit

Permalink
Merge branch 'master' into simonhoenscheid_correct_fixtures_and_metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
lbetz authored Oct 5, 2020
2 parents c3b79f0 + 1f12bac commit 9209289
Show file tree
Hide file tree
Showing 38 changed files with 80 additions and 201 deletions.
2 changes: 2 additions & 0 deletions .fixtures.puppet4.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
fixtures:
forge_modules:
stdlib:
repo: icinga/icinga
stdlib:
repo: puppetlabs/stdlib
ref: 5.2.0
Expand Down
2 changes: 1 addition & 1 deletion .fixtures.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
fixtures:
forge_modules:
forge_modules:
icinga:
repo: icinga/icinga
stdlib:
Expand Down
7 changes: 0 additions & 7 deletions data/Debian-family.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,3 @@
icinga2::globals::user: nagios
icinga2::globals::group: nagios
icinga2::globals::icinga2_bin: /usr/sbin/icinga2
icinga2::repo:
location: http://packages.icinga.com/debian
release: 'icinga-%{facts.os.distro.codename}'
repos: main
key:
id: F51A91A5EE001AA5D77D53C4C6E319C334410682
source: http://packages.icinga.com/icinga.key
3 changes: 0 additions & 3 deletions data/Fedora.yaml

This file was deleted.

3 changes: 0 additions & 3 deletions data/OpenSuSE.yaml

This file was deleted.

6 changes: 0 additions & 6 deletions data/RedHat-family.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,3 @@ icinga2::globals::user: icinga
icinga2::globals::group: icinga
icinga2::globals::icinga2_bin: /sbin/icinga2
icinga2::globals::selinux_package_name: icinga2-selinux
icinga2::repo:
baseurl: 'http://packages.icinga.com/epel/%{facts.os.release.major}/release/'
descr: ICINGA (stable release for epel)
enabled: 1
gpgcheck: 1
gpgkey: http://packages.icinga.com/icinga.key
5 changes: 0 additions & 5 deletions data/Suse-family.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,3 @@
icinga2::globals::user: icinga
icinga2::globals::group: icinga
icinga2::globals::icinga2_bin: /usr/sbin/icinga2
icinga2::repo:
baseurl: 'http://packages.icinga.com/SUSE/%{facts.os.release.full}/release/'
enabled: 1
gpgcheck: 1
gpgkey: http://packages.icinga.com/icinga.key
3 changes: 0 additions & 3 deletions data/Ubuntu.yaml

This file was deleted.

10 changes: 6 additions & 4 deletions examples/example_config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
}

file { '/etc/icinga2/example.d':
ensure => directory,
tag => 'icinga2::config::file',
ensure => directory,
tag => 'icinga2::config::file',
purge => true,
recurse => true,
}


Expand Down Expand Up @@ -104,9 +106,9 @@

::icinga2::object::service { 'disk':
target => '/etc/icinga2/example.d/services.conf',
apply => 'fs => config in host.vars.disks',
apply => 'disk => config in host.vars.disks',
import => [ 'generic-service' ],
check_command => 'disk',
check_command => '-:"disk"',
vars => '+ config',
}

Expand Down
22 changes: 16 additions & 6 deletions examples/example_service_mysql.pp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@
}

file { '/etc/icinga2/example.d':
ensure => directory,
tag => 'icinga2::config::file',
ensure => directory,
tag => 'icinga2::config::file',
purge => true,
recurse => true,
}

/*
Expand All @@ -40,7 +42,7 @@
remove_default_accounts => true,
}

mysq::db { 'icinga2':
mysql::db { 'icinga2':
user => 'icinga2',
password => 'icinga2',
host => 'localhost',
Expand Down Expand Up @@ -92,11 +94,19 @@
/*
* Services
*/
::icinga2::object::service { 'generic-service':
template => true,
target => '/etc/icinga2/example.d/templates.conf',
check_interval => '1m',
retry_interval => '30s',
max_check_attempts => 5,
}

::icinga2::object::service { 'mysql':
target => '/etc/icinga2/example.d/services.conf',
apply => 'mysql => config in host.vars.mysql',
import => ['generic-service'],
check_command => 'mysql',
check_command => '-:"mysql"',
assign => ['host.vars.mysql'],
vars => 'vars + config',
}
Expand All @@ -105,8 +115,8 @@
target => '/etc/icinga2/example.d/services.conf',
apply => 'mysql_health => config in host.vars.mysql_health',
import => ['generic-service'],
check_command => 'mysql_health',
command_endpoint => 'host.vars.client_endpoint',
check_command => '-:"mysql_health"',
# command_endpoint => 'host.vars.client_endpoint',
assign => ['host.vars.mysql_health'],
vars => 'vars + config',
}
10 changes: 1 addition & 9 deletions examples/init_api.pp
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
case $::osfamily {
'redhat': {
package { 'epel-release': }
} # RedHat
}

class { 'icinga2':
manage_repo => true,
}
class { 'icinga2': }

class { '::icinga2::feature::api':
pki => none,
Expand Down
7 changes: 0 additions & 7 deletions examples/init_confd.pp
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
case $::osfamily {
'redhat': {
package { 'epel-release': }
} # RedHat
}

class { 'icinga2':
manage_repo => true,
confd => '/etc/icinga2/local.d',
}

Expand Down
3 changes: 3 additions & 0 deletions examples/init_icingadb.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
if Integer($::facts['os']['release']['major']) < 8 {
$epel = true
$backports = false
} else {
$epel = false
$backports = false
}
} # RedHat
'debian', 'ubuntu': {
Expand Down
12 changes: 2 additions & 10 deletions examples/init_idomysql.pp
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
case $::osfamily {
'redhat': {
package { 'epel-release': }
} # RedHat
}

$dbpass = 'super)secret'

include ::mysql::server

mysql::db { 'icinga2':
user => 'icinga2',
password => $dbpass,
password => 'supersecret',
host => 'localhost',
grant => ['SELECT', 'INSERT', 'UPDATE', 'DELETE', 'DROP', 'CREATE VIEW', 'CREATE', 'INDEX', 'EXECUTE', 'ALTER'],
}
Expand All @@ -21,7 +13,7 @@

class{ '::icinga2::feature::idomysql':
user => 'icinga2',
password => $dbpass,
password => 'supersecret',
database => 'icinga2',
import_schema => true,
require => Mysql::Db['icinga2'],
Expand Down
6 changes: 0 additions & 6 deletions examples/init_idomysql_ssl.pp
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
case $::osfamily {
'redhat': {
package { 'epel-release': }
} # RedHat
}

file { '/etc/mysql':
ensure => directory,
}
Expand Down
12 changes: 3 additions & 9 deletions examples/init_idopgsql.pp
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
case $::osfamily {
'redhat': {
package { 'epel-release': }
} # RedHat
}

include ::postgresql::server

postgresql::server::db { 'icinga2':
Expand All @@ -16,9 +10,9 @@
}

class{ 'icinga2::feature::idopgsql':
user => "icinga2",
password => "supersecret",
database => "icinga2",
user => 'icinga2',
password => 'supersecret',
database => 'icinga2',
import_schema => true,
require => Postgresql::Server::Db['icinga2'],
}
6 changes: 0 additions & 6 deletions examples/init_influxdb.pp
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
case $::osfamily {
'redhat': {
package { 'epel-release': }
} # RedHat
}

class { 'icinga2':
manage_repo => true,
}
Expand Down
6 changes: 0 additions & 6 deletions examples/init_master.pp
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
case $::osfamily {
'redhat': {
package { 'epel-release': }
} # RedHat
}

class { '::icinga2':
manage_repo => true,
constants => {
Expand Down
7 changes: 0 additions & 7 deletions examples/init_plugins.pp
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
case $::osfamily {
'redhat': {
package { 'epel-release': }
} # RedHat
}

class { 'icinga2':
manage_repo => true,
plugins => [ 'plugins', 'plugins-contrib', 'windows-plugins', 'nscp' ]
}
20 changes: 0 additions & 20 deletions examples/init_repo.pp
Original file line number Diff line number Diff line change
@@ -1,23 +1,3 @@
case $::facts['os']['name'] {
'redhat', 'centos': {
if Integer($::facts['os']['release']['major']) < 8 {
$epel = true
$backports = false
}
} # RedHat
'debian', 'ubuntu': {
if $::facts['os']['distro']['codename'] in [ 'stretch', 'trusty' ] {
$epel = false
$backports = true
}
} # Debian
}

class { '::icinga::repos':
manage_epel => $epel,
configure_backports => $backports,
}

class { 'icinga2':
manage_repo => true,
}
6 changes: 0 additions & 6 deletions examples/init_slave.pp
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
case $::osfamily {
'redhat': {
package { 'epel-release': }
} # RedHat
}

$master_cert = 'master.localdomain'
$master_ip = '192.168.5.16'

Expand Down
6 changes: 0 additions & 6 deletions examples/init_slave_validate.pp
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
case $::osfamily {
'redhat': {
package { 'epel-release': }
} # RedHat
}

$master_cert = 'master.localdomain'
$master_ip = '192.168.5.12'

Expand Down
10 changes: 1 addition & 9 deletions examples/init_syslog.pp
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
case $::osfamily {
'redhat': {
package { 'epel-release': }
} # RedHat
}

class { 'icinga2':
manage_repo => true,
}
include icinga2

class { '::icinga2::feature::syslog':
severity => 'critical',
Expand Down
10 changes: 1 addition & 9 deletions examples/objects_from_hiera.pp
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,7 @@
# - generic-service
# target: /etc/icinga2/conf.d/services.conf

case $::osfamily {
'redhat': {
package { 'epel-release': }
} # RedHat
}

class { 'icinga2':
manage_repo => true,
}
include icinga2

$defaults = lookup('monitoring::defaults')

Expand Down
2 changes: 1 addition & 1 deletion manifests/feature/elasticsearch.pp
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
# The password parameter isn't parsed anymore.
# lint:ignore:variables_not_enclosed
if $password {
$_password = "-:\"$password\""
$_password = "-:\"${password}\""
} else {
$_password = undef
}
Expand Down
2 changes: 1 addition & 1 deletion manifests/feature/icingadb.pp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
# lint:ignore:variables_not_enclosed
# The password parameter isn't parsed anymore.
if $password {
$_password = "-:\"$password\""
$_password = "-:\"${password}\""
} else {
$_password = undef
}
Expand Down
2 changes: 1 addition & 1 deletion manifests/feature/idomysql.pp
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@
port => $port,
socket_path => $socket_path,
user => $user,
password => "-:\"$password\"", # The password parameter isn't parsed anymore.
password => "-:\"${password}\"", # The password parameter isn't parsed anymore.
database => $database,
table_prefix => $table_prefix,
instance_name => $instance_name,
Expand Down
2 changes: 1 addition & 1 deletion manifests/feature/idopgsql.pp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
host => $host,
port => $port,
user => $user,
password => "-:\"$password\"", # The password parameter isn't parsed anymore.
password => "-:\"${password}\"", # The password parameter isn't parsed anymore.
database => $database,
table_prefix => $table_prefix,
instance_name => $instance_name,
Expand Down
2 changes: 1 addition & 1 deletion manifests/feature/influxdb.pp
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@
# lint:ignore:variables_not_enclosed
# The password parameter isn't parsed anymore.
if $password {
$_password = "-:\"$password\""
$_password = "-:\"${password}\""
} else {
$_password = undef
}
Expand Down
2 changes: 0 additions & 2 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,6 @@
-> Concat <| tag == 'icinga2::config::file' |>
~> Class['::icinga2::service']

# Put ::icinga2::repo outside to work around dependency cycle issues with the apt module
# and to use this class independently.
if $::icinga2::manage_repo {
require ::icinga::repos
}
Expand Down
Loading

0 comments on commit 9209289

Please sign in to comment.