Defined Type: sssd::domain

Defined in:
manifests/domain.pp

Overview

Define: sssd::domain

This define sets up a domain section of /etc/sssd.conf. This domain will be named after ‘$name’ and should be listed in your main sssd.conf if you wish to activate it.

You will need to call the associated provider segments to make this fully functional.

It is entirely possible to make a configuration file that is complete nonsense by failing to set the correct combinations of providers. See the SSSD documentation for details.

When you call the associated providers, you should be sure to name them based on the name of this domain.

Full documentation of the parameters that map directly to SSSD configuration options can be found in the sssd.conf(5) man page.

Parameters:

  • name

    The name of the domain. This will be placed at [domain/$name] in the configuration file.

  • id_provider (Sssd::IdProvider)
  • debug_level (Optional[Sssd::DebugLevel]) (defaults to: undef)
  • debug_timestamps (Boolean) (defaults to: true)
  • debug_microseconds (Boolean) (defaults to: false)
  • description (Optional[String]) (defaults to: undef)
  • min_id (Integer[0]) (defaults to: 1)
  • max_id (Integer[0]) (defaults to: 0)
  • enumerate (Boolean) (defaults to: false)
  • subdomain_enumerate (Boolean) (defaults to: false)
  • force_timeout (Optional[Integer]) (defaults to: undef)
  • entry_cache_timeout (Optional[Integer]) (defaults to: undef)
  • entry_cache_user_timeout (Optional[Integer]) (defaults to: undef)
  • entry_cache_group_timeout (Optional[Integer]) (defaults to: undef)
  • entry_cache_netgroup_timeout (Optional[Integer]) (defaults to: undef)
  • entry_cache_service_timeout (Optional[Integer]) (defaults to: undef)
  • entry_cache_sudo_timeout (Optional[Integer]) (defaults to: undef)
  • entry_cache_autofs_timeout (Optional[Integer]) (defaults to: undef)
  • entry_cache_ssh_host_timeout (Optional[Integer]) (defaults to: undef)
  • refresh_expired_interval (Optional[Integer]) (defaults to: undef)
  • cache_credentials (Boolean) (defaults to: false)
  • account_cache_expiration (Integer[0]) (defaults to: 0)
  • pwd_expiration_warning (Optional[Integer[0]]) (defaults to: undef)
  • use_fully_qualified_names (Boolean) (defaults to: false)
  • ignore_group_members (Boolean) (defaults to: true)
  • access_provider (Optional[Sssd::AccessProvider]) (defaults to: undef)
  • auth_provider (Optional[Sssd::AuthProvider]) (defaults to: undef)
  • chpass_provider (Optional[Sssd::ChpassProvider]) (defaults to: undef)
  • sudo_provider (Optional[Enum['ldap', 'ipa','ad','none']]) (defaults to: undef)
  • selinux_provider (Optional[Enum['ipa', 'none']]) (defaults to: undef)
  • subdomains_provider (Optional[Enum['ipa', 'ad','none']]) (defaults to: undef)
  • autofs_provider (Optional[Enum['ad', 'ldap', 'ipa','none']]) (defaults to: undef)
  • hostid_provider (Optional[Enum['ipa', 'none']]) (defaults to: undef)
  • re_expression (Optional[String]) (defaults to: undef)
  • full_name_format (Optional[String]) (defaults to: undef)
  • lookup_family_order (Optional[String]) (defaults to: undef)
  • dns_resolver_timeout (Integer[0]) (defaults to: 5)
  • dns_discovery_domain (Optional[String]) (defaults to: undef)
  • override_gid (Optional[String]) (defaults to: undef)
  • case_sensitive (Variant[Boolean,Enum['preserving']]) (defaults to: true)
  • proxy_fast_alias (Boolean) (defaults to: false)
  • realmd_tags (Optional[String]) (defaults to: undef)
  • proxy_pam_target (Optional[String]) (defaults to: undef)
  • proxy_lib_name (Optional[String]) (defaults to: undef)
  • ldap_user_search_filter (Optional[String]) (defaults to: undef)
  • custom_options (Optional[Hash]) (defaults to: undef)

    If defined, this hash will be used to create the service section instead of the parameters. You must provide all options in the section you want to add. Each entry in the hash will be added as a simple init pair key = value under the section in the sssd.conf file. No error checking will be performed.

Author:



79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
# File 'manifests/domain.pp', line 79

define sssd::domain (
  Sssd::IdProvider                           $id_provider,
  Optional[Sssd::DebugLevel]                 $debug_level                  = undef,
  Boolean                                    $debug_timestamps             = true,
  Boolean                                    $debug_microseconds           = false,
  Optional[String]                           $description                  = undef,
  Integer[0]                                 $min_id                       = 1,
  Integer[0]                                 $max_id                       = 0,
  Boolean                                    $enumerate                    = false,
  Boolean                                    $subdomain_enumerate          = false,
  Optional[Integer]                          $force_timeout                = undef,
  Optional[Integer]                          $entry_cache_timeout          = undef,
  Optional[Integer]                          $entry_cache_user_timeout     = undef,
  Optional[Integer]                          $entry_cache_group_timeout    = undef,
  Optional[Integer]                          $entry_cache_netgroup_timeout = undef,
  Optional[Integer]                          $entry_cache_service_timeout  = undef,
  Optional[Integer]                          $entry_cache_sudo_timeout     = undef,
  Optional[Integer]                          $entry_cache_autofs_timeout   = undef,
  Optional[Integer]                          $entry_cache_ssh_host_timeout = undef,
  Optional[Integer]                          $refresh_expired_interval     = undef,
  Boolean                                    $cache_credentials            = false,
  Integer[0]                                 $account_cache_expiration     = 0,
  Optional[Integer[0]]                       $pwd_expiration_warning       = undef,
  Boolean                                    $use_fully_qualified_names    = false,
  Boolean                                    $ignore_group_members         = true,
  Optional[Sssd::AccessProvider]             $access_provider              = undef,
  Optional[Sssd::AuthProvider]               $auth_provider                = undef,
  Optional[Sssd::ChpassProvider]             $chpass_provider              = undef,
  Optional[Enum['ldap', 'ipa','ad','none']]  $sudo_provider                = undef,
  Optional[Enum['ipa', 'none']]              $selinux_provider             = undef,
  Optional[Enum['ipa', 'ad','none']]         $subdomains_provider          = undef,
  Optional[Enum['ad', 'ldap', 'ipa','none']] $autofs_provider              = undef,
  Optional[Enum['ipa', 'none']]              $hostid_provider              = undef,
  Optional[String]                           $re_expression                = undef,
  Optional[String]                           $full_name_format             = undef,
  Optional[String]                           $lookup_family_order          = undef,
  Integer[0]                                 $dns_resolver_timeout         = 5,
  Optional[String]                           $dns_discovery_domain         = undef,
  Optional[String]                           $override_gid                 = undef,
  Variant[Boolean,Enum['preserving']]        $case_sensitive               = true,
  Boolean                                    $proxy_fast_alias             = false,
  Optional[String]                           $realmd_tags                  = undef,
  Optional[String]                           $proxy_pam_target             = undef,
  Optional[String]                           $proxy_lib_name               = undef,
  Optional[String]                           $ldap_user_search_filter      = undef,
  Optional[Hash]                             $custom_options               = undef,
) {
  # Build configuration lines in order (matching expected test output)
  # Debug settings
  $debug_level_line = $debug_level ? { undef => [], default => ["debug_level = ${debug_level}"] }
  $debug_timestamps_line = ["debug_timestamps = ${debug_timestamps}"]
  $debug_microseconds_line = ["debug_microseconds = ${debug_microseconds}"]

  # Description and basic settings
  $description_line = $description ? { undef => [], default => ["description = ${description}"] }
  $min_id_line = ["min_id = ${min_id}"]
  $max_id_line = ["max_id = ${max_id}"]
  $enumerate_line = ["enumerate = ${enumerate}"]

  # Subdomain and timeout settings
  $subdomain_enumerate_line = $subdomain_enumerate ? { false => [], default => ["subdomain_enumerate = ${subdomain_enumerate}"] }
  $force_timeout_line = $force_timeout ? { undef => [], default => ["force_timeout = ${force_timeout}"] }

  # Entry cache timeout settings
  $entry_cache_timeout_line = $entry_cache_timeout ? { undef => [], default => ["entry_cache_timeout = ${entry_cache_timeout}"] }
  $entry_cache_user_timeout_line = $entry_cache_user_timeout ? { undef => [], default => ["entry_cache_user_timeout = ${entry_cache_user_timeout}"] }
  $entry_cache_group_timeout_line = $entry_cache_group_timeout ? { undef => [], default => ["entry_cache_group_timeout = ${entry_cache_group_timeout}"] }
  $entry_cache_netgroup_timeout_line = $entry_cache_netgroup_timeout ? { undef => [], default => ["entry_cache_netgroup_timeout = ${entry_cache_netgroup_timeout}"] }
  $entry_cache_service_timeout_line = $entry_cache_service_timeout ? { undef => [], default => ["entry_cache_service_timeout = ${entry_cache_service_timeout}"] }
  $entry_cache_sudo_timeout_line = $entry_cache_sudo_timeout ? { undef => [], default => ["entry_cache_sudo_timeout = ${entry_cache_sudo_timeout}"] }
  $entry_cache_autofs_timeout_line = $entry_cache_autofs_timeout ? { undef => [], default => ["entry_cache_autofs_timeout = ${entry_cache_autofs_timeout}"] }
  $entry_cache_ssh_host_timeout_line = $entry_cache_ssh_host_timeout ? { undef => [], default => ["entry_cache_ssh_host_timeout = ${entry_cache_ssh_host_timeout}"] }
  $refresh_expired_interval_line = $refresh_expired_interval ? { undef => [], default => ["refresh_expired_interval = ${refresh_expired_interval}"] }

  # Cache settings
  $cache_credentials_line = ["cache_credentials = ${cache_credentials}"]
  $account_cache_expiration_line = ["account_cache_expiration = ${account_cache_expiration}"]
  $pwd_expiration_warning_line = $pwd_expiration_warning ? { undef => [], default => ["pwd_expiration_warning = ${pwd_expiration_warning}"] }

  # Naming settings
  $use_fully_qualified_names_line = ["use_fully_qualified_names = ${use_fully_qualified_names}"]
  $ignore_group_members_line = ["ignore_group_members = ${ignore_group_members}"]

  # Provider settings (id_provider is required, others optional)
  $id_provider_line = ["id_provider = ${id_provider}"]
  $auth_provider_line = $auth_provider ? { undef => [], default => ["auth_provider = ${auth_provider}"] }
  $access_provider_line = $access_provider ? { undef => [], default => ["access_provider = ${access_provider}"] }
  $chpass_provider_line = $chpass_provider ? { undef => [], default => ["chpass_provider = ${chpass_provider}"] }
  $sudo_provider_line = $sudo_provider ? { undef => [], default => ["sudo_provider = ${sudo_provider}"] }
  $selinux_provider_line = $selinux_provider ? { undef => [], default => ["selinux_provider = ${selinux_provider}"] }
  $subdomains_provider_line = $subdomains_provider ? { undef => [], default => ["subdomains_provider = ${subdomains_provider}"] }
  $autofs_provider_line = $autofs_provider ? { undef => [], default => ["autofs_provider = ${autofs_provider}"] }
  $hostid_provider_line = $hostid_provider ? { undef => [], default => ["hostid_provider = ${hostid_provider}"] }

  # Pattern and formatting settings
  $re_expression_line = $re_expression ? { undef => [], default => ["re_expression = ${re_expression}"] }
  $full_name_format_line = $full_name_format ? { undef => [], default => ["full_name_format = ${full_name_format}"] }
  $lookup_family_order_line = $lookup_family_order ? { undef => [], default => ["lookup_family_order = ${lookup_family_order}"] }

  # DNS settings
  $dns_resolver_timeout_line = ["dns_resolver_timeout = ${dns_resolver_timeout}"]
  $dns_discovery_domain_line = $dns_discovery_domain ? { undef => [], default => ["dns_discovery_domain = ${dns_discovery_domain}"] }

  # Override and case sensitivity settings
  $override_gid_line = $override_gid ? { undef => [], default => ["override_gid = ${override_gid}"] }
  $case_sensitive_line = ["case_sensitive = ${case_sensitive}"]
  $proxy_fast_alias_line = ["proxy_fast_alias = ${proxy_fast_alias}"]

  # Optional provider-specific settings
  $realmd_tags_line = $realmd_tags ? { undef => [], default => ["realmd_tags = ${realmd_tags}"] }
  $ldap_user_search_filter_line = $ldap_user_search_filter ? { undef => [], default => ["ldap_user_search_filter = ${ldap_user_search_filter}"] }
  $proxy_pam_target_line = $proxy_pam_target ? { undef => [], default => ["proxy_pam_target = ${proxy_pam_target}"] }
  $proxy_lib_name_line = $proxy_lib_name ? { undef => [], default => ["proxy_lib_name = ${proxy_lib_name}"] }

  # Custom options processing
  $custom_options_lines = $custom_options ? {
    undef => [],
    default => $custom_options.keys.sort.map |$opt| { "${opt} = ${custom_options[$opt]}" }
  }

  # Combine all lines in order
  $config_lines = (
    $debug_level_line +
    $debug_timestamps_line +
    $debug_microseconds_line +
    $description_line +
    $min_id_line +
    $max_id_line +
    $enumerate_line +
    $subdomain_enumerate_line +
    $force_timeout_line +
    $entry_cache_timeout_line +
    $entry_cache_user_timeout_line +
    $entry_cache_group_timeout_line +
    $entry_cache_netgroup_timeout_line +
    $entry_cache_service_timeout_line +
    $entry_cache_sudo_timeout_line +
    $entry_cache_autofs_timeout_line +
    $entry_cache_ssh_host_timeout_line +
    $refresh_expired_interval_line +
    $cache_credentials_line +
    $account_cache_expiration_line +
    $pwd_expiration_warning_line +
    $use_fully_qualified_names_line +
    $ignore_group_members_line +
    $id_provider_line +
    $auth_provider_line +
    $access_provider_line +
    $chpass_provider_line +
    $sudo_provider_line +
    $selinux_provider_line +
    $subdomains_provider_line +
    $autofs_provider_line +
    $hostid_provider_line +
    $re_expression_line +
    $full_name_format_line +
    $lookup_family_order_line +
    $dns_resolver_timeout_line +
    $dns_discovery_domain_line +
    $override_gid_line +
    $case_sensitive_line +
    $proxy_fast_alias_line +
    $realmd_tags_line +
    $ldap_user_search_filter_line +
    $proxy_pam_target_line +
    $proxy_lib_name_line +
    $custom_options_lines
  )

  # Join all configuration lines
  $content = (["# sssd::domain ${name}"] + $config_lines).join("\n")

  sssd::config::entry { "puppet_domain_${name}":
    content => epp(
      "${module_name}/generic",
      {
        'title'   => "domain/${name}",
        'content' => $content,
      },
    ),
  }
}