Commit 0fd08347 authored by Walter Heck's avatar Walter Heck

fixing small icinga errors

parent 0d3bffae
......@@ -151,9 +151,9 @@
'opstheater::icingaweb::ldap::auth_user_class': 'user'
'opstheater::icingaweb::ldap::auth_user_attribute': 'sAccountName'
'opstheater::icingaweb::ldap::enabled': "%{hiera('opstheater::ldap::enabled')}"
'opstheater::icingaweb::ldap::enabled': %{hiera('opstheater::ldap::enabled')}
'opstheater::icingaweb::ldap::server': "%{hiera('opstheater::ldap::server')}"
'opstheater::icingaweb::ldap::port': "%{hiera('opstheater::ldap::port')}"
'opstheater::icingaweb::ldap::port': %{hiera('opstheater::ldap::port')}
'opstheater::icingaweb::ldap::ssl': "%{hiera('opstheater::ldap::ssl')}"
'opstheater::icingaweb::ldap::username': "%{hiera('opstheater::ldap::username')}"
'opstheater::icingaweb::ldap::password': "%{hiera('opstheater::ldap::password')}"
......
class opstheater::profile::icinga::checks {
Icinga2::Object::Service {
apply => true,
assign => 'host.address && host.vars.remote == true && host.vars.remote_endpoint',
command_endpoint => 'host.vars.remote_endpoint',
target => '/etc/icinga2/zones.d/global-templates/services.conf',
......
......@@ -24,6 +24,17 @@ class opstheater::profile::icinga::server (
icinga2::object::zone { 'global-templates':
global => true,
}
# Zone directories
file { '/etc/icinga2/zones.d/global-templates':
ensure => directory,
owner => 'icinga',
group => 'icinga',
mode => '0750',
tag => 'icinga2::config::file',
}
$lowercase_fqdn = downcase($::fqdn)
class { '::icinga2::feature::api':
......@@ -31,7 +42,7 @@ class opstheater::profile::icinga::server (
# when having multiple masters, you should enable:
# accept_config => true,
endpoints => {
'master.example.org'=> {},
$icinga2_web_fqdn => {},
},
zones => {
'master' => {
......
class opstheater::profile::icinga::web (
$icinga2_web_fqdn = hiera('opstheater::icingaweb::fqdn'),
$icinga2_db_fqdn = hiera('opstheater::icingaweb::mysql_fqdn'),
$icinga2_ssl_cert = "/etc/httpd/ssl/${icinga2_web_fqdn}.crt",
$icinga2_ssl_bundle = "/etc/httpd/ssl/${icinga2_web_fqdn}-cabundle.crt",
$icinga2_ssl_key = "/etc/httpd/ssl/${icinga2_web_fqdn}.key",
$icinga2_db_ipaddress = hiera('opstheater::icingaweb::mysql_ipaddress'),
$icinga2_webdb_password = hiera('opstheater::icingaweb::webdb_password'),
$icinga2_ido_password = hiera('opstheater::icinga::ido_password'),
$manage_package_repo = false,
$manage_epel_repo = false,
$manage_mysql_client = hiera('opstheater::icingaweb::manage_mysql_client'),
$icingaweb_ldap_group_filter = '"cn=Puppet-Admins"',
$icingaweb_ldap_enabled = hiera('opstheater::icingaweb::ldap::enabled'),
$icingaweb_ldap_server = hiera('opstheater::icingaweb::ldap::server'),
$icingaweb_ldap_port = hiera('opstheater::icingaweb::ldap::port'),
$icingaweb_ldap_username = hiera('opstheater::icingaweb::ldap::username'),
$icingaweb_ldap_password = hiera('opstheater::icingaweb::ldap::password'),
$icingaweb_ldap_base_dn = hiera('opstheater::icingaweb::ldap::base_dn'),
$icingaweb_auth_ldap_base_dn = hiera('opstheater::icingaweb::ldap::auth_base_dn'),
$icingaweb_auth_ldap_filter = hiera('opstheater::icingaweb::ldap::auth_filter'),
$icingaweb_auth_ldap_user_class = hiera('opstheater::icingaweb::ldap::auth_user_class'),
$icingaweb_auth_ldap_user_name_attribute = hiera('opstheater::icingaweb::ldap::auth_user_attribute'),
String $icinga2_web_fqdn = hiera('opstheater::icingaweb::fqdn'),
String $icinga2_db_fqdn = hiera('opstheater::icingaweb::mysql_fqdn'),
String $icinga2_ssl_cert = "/etc/httpd/ssl/${icinga2_web_fqdn}.crt",
String $icinga2_ssl_bundle = "/etc/httpd/ssl/${icinga2_web_fqdn}-cabundle.crt",
String $icinga2_ssl_key = "/etc/httpd/ssl/${icinga2_web_fqdn}.key",
String $icinga2_db_ipaddress = hiera('opstheater::icingaweb::mysql_ipaddress'),
String $icinga2_webdb_password = hiera('opstheater::icingaweb::webdb_password'),
String $icinga2_ido_password = hiera('opstheater::icinga::ido_password'),
Boolean $manage_package_repo = false,
Boolean $manage_epel_repo = false,
Boolean $manage_mysql_client = hiera('opstheater::icingaweb::manage_mysql_client'),
String $icingaweb_ldap_group_filter = '"cn=Puppet-Admins"',
String $icingaweb_ldap_enabled = hiera('opstheater::icingaweb::ldap::enabled'),
String $icingaweb_ldap_server = hiera('opstheater::icingaweb::ldap::server'),
String $icingaweb_ldap_port = hiera('opstheater::icingaweb::ldap::port'),
String $icingaweb_ldap_username = hiera('opstheater::icingaweb::ldap::username'),
String $icingaweb_ldap_password = hiera('opstheater::icingaweb::ldap::password'),
String $icingaweb_ldap_base_dn = hiera('opstheater::icingaweb::ldap::base_dn'),
String $icingaweb_auth_ldap_base_dn = hiera('opstheater::icingaweb::ldap::auth_base_dn'),
String $icingaweb_auth_ldap_filter = hiera('opstheater::icingaweb::ldap::auth_filter'),
String $icingaweb_auth_ldap_user_class = hiera('opstheater::icingaweb::ldap::auth_user_class'),
String $icingaweb_auth_ldap_user_name_attribute = hiera('opstheater::icingaweb::ldap::auth_user_attribute'),
) inherits opstheater::profile::params {
# Specifically convert the class parameter to boolean as the hiera call always returns a string
$bool_icingaweb_ldap_enabled = str2bool($icingaweb_ldap_enabled)
# Make our Apache ssl directory
file { '/etc/httpd/ssl':
ensure => directory,
......@@ -120,7 +123,7 @@ class opstheater::profile::icinga::web (
ensure => latest,
}
if $icingaweb_ldap_enabled {
if $bool_icingaweb_ldap_enabled {
Ini_setting {
ensure => present,
......@@ -212,13 +215,6 @@ class opstheater::profile::icinga::web (
}
} else {
file { '/etc/icingaweb2/groups.ini':
ensure => 'file',
mode => '0770',
owner => 'root',
group => 'icingaweb2',
content => "[icingaweb2]\nresource = \"icingaweb_db\"\nbackend = \"db\"\n",
}
class { 'icingaweb2':
manage_repo => $manage_package_repo,
install_method => 'package',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment