module-icingaweb2/manifests/config/resource_ldap.pp
Stefan Kleindl 5a786c6d49 Add possibility to set auth_backend to ldap
next to the already existing possibilities db and external. If auth_backend is set
to ldap an ldap ressource and an ldap authentication configuration is generated.

Also support for ldap encryption is added.
2016-05-12 16:10:51 +02:00

61 lines
1.6 KiB
Puppet

# Define for setting IcingaWeb2 LDAP Resource
#
define icingaweb2::config::resource_ldap (
$resource_bind_dn = undef,
$resource_bind_pw = undef,
$resource_host = undef,
$resource_name = $title,
$resource_port = undef,
$resource_root_dn = undef,
$resource_encryption = undef,
) {
Ini_Setting {
ensure => present,
require => File["${::icingaweb2::config_dir}/resources.ini"],
path => "${::icingaweb2::config_dir}/resources.ini",
}
ini_setting { "icingaweb2 resources ${title} type":
section => $resource_name,
setting => 'type',
value => 'ldap',
}
ini_setting { "icingaweb2 resources ${title} hostname":
section => $resource_name,
setting => 'hostname',
value => "\"${resource_host}\"",
}
ini_setting { "icingaweb2 resources ${title} port":
section => $resource_name,
setting => 'port',
value => "\"${resource_port}\"",
}
ini_setting { "icingaweb2 resources ${title} root_dn":
section => $resource_name,
setting => 'root_dn',
value => "\"${resource_root_dn}\"",
}
ini_setting { "icingaweb2 resources ${title} bind_dn":
section => $resource_name,
setting => 'bind_dn',
value => "\"${resource_bind_dn}\"",
}
ini_setting { "icingaweb2 resources ${title} bind_pw":
section => $resource_name,
setting => 'bind_pw',
value => "\"${resource_bind_pw}\"",
}
if $::icingaweb2::ldap_encryption {
ini_setting { "icingaweb2 resources ${title} encryption":
section => $resource_name,
setting => 'encryption',
value => "\"${resource_encryption}\"",
}
}
}