Added FreeBSD support

This commit is contained in:
Gregory Ballantine 2023-03-30 11:34:41 -04:00
parent 7f59387532
commit 658c6520a0
5 changed files with 35 additions and 29 deletions

3
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,3 @@
{
"puppet.editorService.puppet.version": "7.23.0"
}

View File

@ -109,7 +109,7 @@ class nslcd
Boolean $service_manage = true, Boolean $service_manage = true,
String[1] $uid = 'nslcd', String[1] $uid = 'nslcd',
String[1] $gid = $nslcd::params::gid, String[1] $gid = $nslcd::params::gid,
Stdlib::Unixpath $config = '/etc/nslcd.conf', Stdlib::Unixpath $config = $nslcd::params::config,
String[1] $config_user = 'root', String[1] $config_user = 'root',
String[1] $config_group = $nslcd::params::config_group, String[1] $config_group = $nslcd::params::config_group,
Stdlib::Filemode $config_mode = $nslcd::params::config_mode, Stdlib::Filemode $config_mode = $nslcd::params::config_mode,
@ -141,4 +141,4 @@ inherits nslcd::params
Class['nslcd::install'] Class['nslcd::install']
-> Class['nslcd::config'] -> Class['nslcd::config']
~> Class['nslcd::service'] ~> Class['nslcd::service']
} }

View File

@ -2,27 +2,31 @@
# #
# Sets the default parameters for the nslcd class. # Sets the default parameters for the nslcd class.
# #
class nslcd::params class nslcd::params {
{ case $::osfamily {
case $::osfamily 'Debian': {
{
'Debian':
{
$package_name = 'nslcd' $package_name = 'nslcd'
$gid = 'nslcd' $gid = 'nslcd'
$config = '/etc/nslcd.conf'
$config_group = 'nslcd' $config_group = 'nslcd'
$config_mode = '0640' $config_mode = '0640'
} }
'RedHat': 'RedHat': {
{
$package_name = 'nss-pam-ldapd' $package_name = 'nss-pam-ldapd'
$gid = 'ldap' $gid = 'ldap'
$config = '/etc/nslcd.conf'
$config_group = 'root' $config_group = 'root'
$config_mode = '0600' $config_mode = '0600'
} }
default: 'FreeBSD': {
{ $package_name = 'nss-pam-ldapd'
$gid = 'nslcd'
$config = '/usr/local/etc/nslcd.conf'
$config_group = 'wheel'
$config_mode = '0600'
}
default: {
fail("The ${module_name} module is not supported on an ${::osfamily} based system.") fail("The ${module_name} module is not supported on an ${::osfamily} based system.")
} }
} }
} }

View File

@ -2,16 +2,12 @@
# #
# Manages the nslcd service. # Manages the nslcd service.
# #
class nslcd::service inherits nslcd class nslcd::service inherits nslcd {
{ if $nslcd::service_manage {
if $nslcd::service_manage service { 'nslcd':
{ ensure => $nslcd::service_ensure,
service enable => $nslcd::service_enable,
{ name => $nslcd::service_name,
'nslcd':
ensure => $nslcd::service_ensure,
enable => $nslcd::service_enable,
name => $nslcd::service_name,
} }
} }
} }

View File

@ -1,12 +1,12 @@
{ {
"name": "geekix-nslcd", "name": "ascendings-nslcd",
"version": "0.4.3", "version": "0.4.3",
"author": "geekix", "author": "ascendings",
"summary": "Installs and configures nslcd.", "summary": "Installs and configures nslcd.",
"license": "Apache-2.0", "license": "Apache-2.0",
"source": "https://github.com/geekix/puppet-nslcd", "source": "https://git.metaunix.net/Metaunix/puppet-nslcd",
"project_page": "https://github.com/geekix/puppet-nslcd", "project_page": "https://git.metaunix.net/Metaunix/puppet-nslcd",
"issues_url": "https://github.com/geekix/puppet-nslcd/issues", "issues_url": "https://git.metaunix.net/Metaunix/puppet-nslcd/issues",
"dependencies": [ "dependencies": [
{ {
"name": "puppetlabs-stdlib", "name": "puppetlabs-stdlib",
@ -38,6 +38,9 @@
"7", "7",
"8" "8"
] ]
},
{
"operatingsystem": "FreeBSD"
} }
], ],
"requirements": [ "requirements": [