Defined Type: sssd::config
- Defined in:
- manifests/config.pp
Summary
Write out an SSSD compatible config fileOverview
Transform a Hash of settings into a deterministic sssd compatible config file.
The strings will be used “as is”, and arrays will be joined with ‘, ’ which should let you set things in a number of useful ways.
sssd:config {'LDAP':
stanzas => {
'domain/LDAP' =>
'id_provider' => 'ldap'
}
}
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'manifests/config.pp', line 50
define sssd::config (
Hash $stanzas,
String $owner = 'root',
String $group = 'root',
String $mode = '0600',
Integer[0, 99] $order = 50,
Optional[Pattern[/\.conf$/]] $filename = undef,
Stdlib::Absolutepath $config_d_location = '/etc/sssd/conf.d',
Optional[Stdlib::Absolutepath] $force_this_filename = undef
) {
if ! defined(Class['sssd']) {
fail('You must include the sssd base class before using any defined resources')
}
if $force_this_filename != undef {
$full_path = $force_this_filename
} else {
if $filename == undef {
$dynamic_title = join(sort($stanzas.keys), '_')
$filename_escape = regsubst(downcase($dynamic_title), '[/\.]', '_', 'G')
$filename_real = "${order}-${filename_escape}.conf"
} else {
$filename_real = $filename
}
$full_path = "${config_d_location}/${filename_real}"
}
file { $full_path:
ensure => 'file',
owner => $owner,
group => $group,
mode => $mode,
content => epp('sssd/etc/sssd/sssd.conf.epp', { 'stanzas' => $stanzas }),
notify => Class['Sssd::Service'],
}
}
|