Upgrade module to version 0.4.2 (see changelog)

This commit is contained in:
geekix
2021-11-06 12:36:59 +01:00
parent c63004c8fe
commit 8b46443435
37 changed files with 1065 additions and 317 deletions

View File

@ -1,14 +1,16 @@
# == Class: nslcd::config
#
# Manages the nslcd server configuration file
class nslcd::config inherits nslcd {
file { $nslcd::config:
ensure => file,
owner => $nslcd::config_user,
group => $nslcd::config_group,
mode => $nslcd::config_mode,
content => template('nslcd/nslcd.erb'),
#
class nslcd::config inherits nslcd
{
file
{
$nslcd::config:
ensure => file,
owner => $nslcd::config_user,
group => $nslcd::config_group,
mode => $nslcd::config_mode,
content => template('nslcd/nslcd.erb'),
}
}
}

View File

@ -1,7 +1,105 @@
# == Class: nslcd
#
# This class manages the nslcd server and service.
class nslcd (
#
# @param package_ensure
# Sets if the package should be present or absent.
#
# @param package_name
# Name of the package to install. Depends on the Linux distrib.
# Set if your platform is not supported.
#
# @param package_manage
# Sets if the module should manage or not the package installation.
#
# @param service_ensure
# Sets if the service should be running or stopped.
#
# @param service_enable
# Sets if the service should be started on startup.
#
# @param service_name
# Sets the name of the service.
# Set if your platform is not supported.
#
# @param service_manage
# Sets if the module should manage or not the service.
#
# @param uid
# Sets the user to start the daemon.
#
# @param gid
# Sets the group to start the daemon. Depends on the Linux distrib.
#
# @param config
# Sets the path of the config file.
#
# @param config_user
# Sets the owner of the config file.
#
# @param config_group
# Sets the group of the config file. Depends on the Linux distrib.
#
# @param config_mode
# Permission of the config file. Depends on the Linux distrib.
#
# @param ldap_uris
# Array of LDAP servers.
#
# @param ldap_version
# Sets the LDAP version to use.
#
# @param ldap_binddn
# Sets the DN (distinguished name) to bind to the LDAP servers.
#
# @param ldap_bindpw
# Sets the password to bind to the LDAP servers. Only used if the parameter ldap_binddn is set.
#
# @param ldap_search_base
# Sets the base DN (distinguished name) to use as the search base.
#
# @param ldap_group_base
# Sets the base DN (distinguished name) to use as the group search base.
#
# @param ldap_search_scope
# Sets the search scope depth.
#
# @param config_options
# Key/Value hash to extend initial configuration.
#
# @param ldap_filters
# Sets the LDAP search filter for specific mapping.
#
# @param ldap_maps
# Allows for custom attributes to be looked up.
#
# @param ldap_ssl
# Whether to use SSL/TLS for the connexion to the LDAP servers.
#
# @param ldap_tls_reqcert
# Sets what checks to perform on a server-supplied certificate.
#
# @param ldap_tls_cacertfile
# Sets the path of the PEM-format file containing certificates for the CA's that will be trusted.
#
# @param bind_timelimit
# Sets the time limit (in seconds) to setup a connexion with the LDAP server.
#
# @param timelimit
# Sets the time limit (in seconds) to wait for a response from the LDAP server.
#
# @param idle_timelimit
# Sets the period if inactivity (in seconds) after which the connection to the LDAP server will be closed.
#
# @param reconnect_sleeptime
# Sets the number of seconds to sleep when connecting to all LDAP servers fails.
#
# @param reconnect_retrytime
# Sets the time after which the LDAP server is considered to be permanently unavailable.
# Once this time is reached retries will be done only once per this time period.
#
class nslcd
(
Variant[Boolean,String[1]] $package_ensure = 'present',
String[1] $package_name = $nslcd::params::package_name,
Boolean $package_manage = true,
@ -26,16 +124,21 @@ class nslcd (
Hash $ldap_filters = {},
Hash $ldap_maps = {},
Enum['on','off','start_tls'] $ldap_ssl = 'off',
Enum['never','allow','try','demand','hard' ] $ldap_tls_reqcert = 'allow',
Enum['never','allow','try','demand','hard'] $ldap_tls_reqcert = 'allow',
Optional[String[1]] $ldap_tls_cacertfile = undef,
) inherits nslcd::params {
Optional[Integer] $bind_timelimit = undef,
Integer $timelimit = 10,
Optional[Integer] $idle_timelimit = undef,
Integer $reconnect_sleeptime = 1,
Integer $reconnect_retrytime = 10,
)
inherits nslcd::params
{
contain nslcd::install
contain nslcd::config
contain nslcd::service
Class['nslcd::install']
-> Class['nslcd::config']
~> Class['nslcd::service']
}
}

View File

@ -1,12 +1,15 @@
# == Class: nslcd::install
#
# Installs the nslcd package.
class nslcd::install inherits nslcd {
if $nslcd::package_manage {
package { $nslcd::package_name:
ensure => $nslcd::package_ensure,
#
class nslcd::install inherits nslcd
{
if $nslcd::package_manage
{
package
{
$nslcd::package_name:
ensure => $nslcd::package_ensure,
}
}
}
}

View File

@ -1,24 +1,28 @@
# == Class: nslcd::params
#
# Sets the default parameters for the nslcd class.
class nslcd::params {
case $::osfamily {
'Debian': {
#
class nslcd::params
{
case $::osfamily
{
'Debian':
{
$package_name = 'nslcd'
$gid = 'nslcd'
$config_group = 'nslcd'
$config_mode = '0640'
}
'RedHat': {
'RedHat':
{
$package_name = 'nss-pam-ldapd'
$gid = 'ldap'
$config_group = 'root'
$config_mode = '0600'
}
default: {
default:
{
fail("The ${module_name} module is not supported on an ${::osfamily} based system.")
}
}
}
}

View File

@ -1,14 +1,17 @@
# == Class: nslcd::service
#
# Manages the nslcd service.
class nslcd::service inherits nslcd {
if $nslcd::service_manage {
service { 'nslcd':
ensure => $nslcd::service_ensure,
enable => $nslcd::service_enable,
name => $nslcd::service_name,
#
class nslcd::service inherits nslcd
{
if $nslcd::service_manage
{
service
{
'nslcd':
ensure => $nslcd::service_ensure,
enable => $nslcd::service_enable,
name => $nslcd::service_name,
}
}
}
}