|
123 | 123 | Optional[String] $ldap_user_search_filter = undef, |
124 | 124 | Optional[Hash] $custom_options = undef, |
125 | 125 | ) { |
| 126 | + # Build configuration lines in order (matching expected test output) |
| 127 | + # Debug settings |
| 128 | + $debug_level_line = $debug_level ? { undef => [], default => ["debug_level = ${debug_level}"] } |
| 129 | + $debug_timestamps_line = ["debug_timestamps = ${debug_timestamps}"] |
| 130 | + $debug_microseconds_line = ["debug_microseconds = ${debug_microseconds}"] |
| 131 | + |
| 132 | + # Description and basic settings |
| 133 | + $description_line = $description ? { undef => [], default => ["description = ${description}"] } |
| 134 | + $min_id_line = ["min_id = ${min_id}"] |
| 135 | + $max_id_line = ["max_id = ${max_id}"] |
| 136 | + $enumerate_line = ["enumerate = ${enumerate}"] |
| 137 | + |
| 138 | + # Subdomain and timeout settings |
| 139 | + $subdomain_enumerate_line = $subdomain_enumerate ? { false => [], default => ["subdomain_enumerate = ${subdomain_enumerate}"] } |
| 140 | + $force_timeout_line = $force_timeout ? { undef => [], default => ["force_timeout = ${force_timeout}"] } |
| 141 | + |
| 142 | + # Entry cache timeout settings |
| 143 | + $entry_cache_timeout_line = $entry_cache_timeout ? { undef => [], default => ["entry_cache_timeout = ${entry_cache_timeout}"] } |
| 144 | + $entry_cache_user_timeout_line = $entry_cache_user_timeout ? { undef => [], default => ["entry_cache_user_timeout = ${entry_cache_user_timeout}"] } |
| 145 | + $entry_cache_group_timeout_line = $entry_cache_group_timeout ? { undef => [], default => ["entry_cache_group_timeout = ${entry_cache_group_timeout}"] } |
| 146 | + $entry_cache_netgroup_timeout_line = $entry_cache_netgroup_timeout ? { undef => [], default => ["entry_cache_netgroup_timeout = ${entry_cache_netgroup_timeout}"] } |
| 147 | + $entry_cache_service_timeout_line = $entry_cache_service_timeout ? { undef => [], default => ["entry_cache_service_timeout = ${entry_cache_service_timeout}"] } |
| 148 | + $entry_cache_sudo_timeout_line = $entry_cache_sudo_timeout ? { undef => [], default => ["entry_cache_sudo_timeout = ${entry_cache_sudo_timeout}"] } |
| 149 | + $entry_cache_autofs_timeout_line = $entry_cache_autofs_timeout ? { undef => [], default => ["entry_cache_autofs_timeout = ${entry_cache_autofs_timeout}"] } |
| 150 | + $entry_cache_ssh_host_timeout_line = $entry_cache_ssh_host_timeout ? { undef => [], default => ["entry_cache_ssh_host_timeout = ${entry_cache_ssh_host_timeout}"] } |
| 151 | + $refresh_expired_interval_line = $refresh_expired_interval ? { undef => [], default => ["refresh_expired_interval = ${refresh_expired_interval}"] } |
| 152 | + |
| 153 | + # Cache settings |
| 154 | + $cache_credentials_line = ["cache_credentials = ${cache_credentials}"] |
| 155 | + $account_cache_expiration_line = ["account_cache_expiration = ${account_cache_expiration}"] |
| 156 | + $pwd_expiration_warning_line = $pwd_expiration_warning ? { undef => [], default => ["pwd_expiration_warning = ${pwd_expiration_warning}"] } |
| 157 | + |
| 158 | + # Naming settings |
| 159 | + $use_fully_qualified_names_line = ["use_fully_qualified_names = ${use_fully_qualified_names}"] |
| 160 | + $ignore_group_members_line = ["ignore_group_members = ${ignore_group_members}"] |
| 161 | + |
| 162 | + # Provider settings (id_provider is required, others optional) |
| 163 | + $id_provider_line = ["id_provider = ${id_provider}"] |
| 164 | + $auth_provider_line = $auth_provider ? { undef => [], default => ["auth_provider = ${auth_provider}"] } |
| 165 | + $access_provider_line = $access_provider ? { undef => [], default => ["access_provider = ${access_provider}"] } |
| 166 | + $chpass_provider_line = $chpass_provider ? { undef => [], default => ["chpass_provider = ${chpass_provider}"] } |
| 167 | + $sudo_provider_line = $sudo_provider ? { undef => [], default => ["sudo_provider = ${sudo_provider}"] } |
| 168 | + $selinux_provider_line = $selinux_provider ? { undef => [], default => ["selinux_provider = ${selinux_provider}"] } |
| 169 | + $subdomains_provider_line = $subdomains_provider ? { undef => [], default => ["subdomains_provider = ${subdomains_provider}"] } |
| 170 | + $autofs_provider_line = $autofs_provider ? { undef => [], default => ["autofs_provider = ${autofs_provider}"] } |
| 171 | + $hostid_provider_line = $hostid_provider ? { undef => [], default => ["hostid_provider = ${hostid_provider}"] } |
| 172 | + |
| 173 | + # Pattern and formatting settings |
| 174 | + $re_expression_line = $re_expression ? { undef => [], default => ["re_expression = ${re_expression}"] } |
| 175 | + $full_name_format_line = $full_name_format ? { undef => [], default => ["full_name_format = ${full_name_format}"] } |
| 176 | + $lookup_family_order_line = $lookup_family_order ? { undef => [], default => ["lookup_family_order = ${lookup_family_order}"] } |
| 177 | + |
| 178 | + # DNS settings |
| 179 | + $dns_resolver_timeout_line = ["dns_resolver_timeout = ${dns_resolver_timeout}"] |
| 180 | + $dns_discovery_domain_line = $dns_discovery_domain ? { undef => [], default => ["dns_discovery_domain = ${dns_discovery_domain}"] } |
| 181 | + |
| 182 | + # Override and case sensitivity settings |
| 183 | + $override_gid_line = $override_gid ? { undef => [], default => ["override_gid = ${override_gid}"] } |
| 184 | + $case_sensitive_line = ["case_sensitive = ${case_sensitive}"] |
| 185 | + $proxy_fast_alias_line = ["proxy_fast_alias = ${proxy_fast_alias}"] |
| 186 | + |
| 187 | + # Optional provider-specific settings |
| 188 | + $realmd_tags_line = $realmd_tags ? { undef => [], default => ["realmd_tags = ${realmd_tags}"] } |
| 189 | + $ldap_user_search_filter_line = $ldap_user_search_filter ? { undef => [], default => ["ldap_user_search_filter = ${ldap_user_search_filter}"] } |
| 190 | + $proxy_pam_target_line = $proxy_pam_target ? { undef => [], default => ["proxy_pam_target = ${proxy_pam_target}"] } |
| 191 | + $proxy_lib_name_line = $proxy_lib_name ? { undef => [], default => ["proxy_lib_name = ${proxy_lib_name}"] } |
| 192 | + |
| 193 | + # Custom options processing |
| 194 | + $custom_options_lines = $custom_options ? { |
| 195 | + undef => [], |
| 196 | + default => $custom_options.keys.sort.map |$opt| { "${opt} = ${custom_options[$opt]}" } |
| 197 | + } |
| 198 | + |
| 199 | + # Combine all lines in order |
| 200 | + $config_lines = ( |
| 201 | + $debug_level_line + |
| 202 | + $debug_timestamps_line + |
| 203 | + $debug_microseconds_line + |
| 204 | + $description_line + |
| 205 | + $min_id_line + |
| 206 | + $max_id_line + |
| 207 | + $enumerate_line + |
| 208 | + $subdomain_enumerate_line + |
| 209 | + $force_timeout_line + |
| 210 | + $entry_cache_timeout_line + |
| 211 | + $entry_cache_user_timeout_line + |
| 212 | + $entry_cache_group_timeout_line + |
| 213 | + $entry_cache_netgroup_timeout_line + |
| 214 | + $entry_cache_service_timeout_line + |
| 215 | + $entry_cache_sudo_timeout_line + |
| 216 | + $entry_cache_autofs_timeout_line + |
| 217 | + $entry_cache_ssh_host_timeout_line + |
| 218 | + $refresh_expired_interval_line + |
| 219 | + $cache_credentials_line + |
| 220 | + $account_cache_expiration_line + |
| 221 | + $pwd_expiration_warning_line + |
| 222 | + $use_fully_qualified_names_line + |
| 223 | + $ignore_group_members_line + |
| 224 | + $id_provider_line + |
| 225 | + $auth_provider_line + |
| 226 | + $access_provider_line + |
| 227 | + $chpass_provider_line + |
| 228 | + $sudo_provider_line + |
| 229 | + $selinux_provider_line + |
| 230 | + $subdomains_provider_line + |
| 231 | + $autofs_provider_line + |
| 232 | + $hostid_provider_line + |
| 233 | + $re_expression_line + |
| 234 | + $full_name_format_line + |
| 235 | + $lookup_family_order_line + |
| 236 | + $dns_resolver_timeout_line + |
| 237 | + $dns_discovery_domain_line + |
| 238 | + $override_gid_line + |
| 239 | + $case_sensitive_line + |
| 240 | + $proxy_fast_alias_line + |
| 241 | + $realmd_tags_line + |
| 242 | + $ldap_user_search_filter_line + |
| 243 | + $proxy_pam_target_line + |
| 244 | + $proxy_lib_name_line + |
| 245 | + $custom_options_lines |
| 246 | + ) |
| 247 | + |
| 248 | + # Join all configuration lines |
| 249 | + $content = $config_lines.join("\n") |
| 250 | + |
126 | 251 | sssd::config::entry { "puppet_domain_${name}": |
127 | | - content => epp( |
128 | | - 'sssd/domain.epp', |
129 | | - { |
130 | | - 'id_provider' => $id_provider, |
131 | | - 'debug_level' => $debug_level, |
132 | | - 'debug_timestamps' => $debug_timestamps, |
133 | | - 'debug_microseconds' => $debug_microseconds, |
134 | | - 'description' => $description, |
135 | | - 'min_id' => $min_id, |
136 | | - 'max_id' => $max_id, |
137 | | - 'enumerate' => $enumerate, |
138 | | - 'subdomain_enumerate' => $subdomain_enumerate, |
139 | | - 'force_timeout' => $force_timeout, |
140 | | - 'entry_cache_timeout' => $entry_cache_timeout, |
141 | | - 'entry_cache_user_timeout' => $entry_cache_user_timeout, |
142 | | - 'entry_cache_group_timeout' => $entry_cache_group_timeout, |
143 | | - 'entry_cache_netgroup_timeout' => $entry_cache_netgroup_timeout, |
144 | | - 'entry_cache_service_timeout' => $entry_cache_service_timeout, |
145 | | - 'entry_cache_sudo_timeout' => $entry_cache_sudo_timeout, |
146 | | - 'entry_cache_autofs_timeout' => $entry_cache_autofs_timeout, |
147 | | - 'entry_cache_ssh_host_timeout' => $entry_cache_ssh_host_timeout, |
148 | | - 'refresh_expired_interval' => $refresh_expired_interval, |
149 | | - 'cache_credentials' => $cache_credentials, |
150 | | - 'account_cache_expiration' => $account_cache_expiration, |
151 | | - 'pwd_expiration_warning' => $pwd_expiration_warning, |
152 | | - 'use_fully_qualified_names' => $use_fully_qualified_names, |
153 | | - 'ignore_group_members' => $ignore_group_members, |
154 | | - 'access_provider' => $access_provider, |
155 | | - 'auth_provider' => $auth_provider, |
156 | | - 'chpass_provider' => $chpass_provider, |
157 | | - 'sudo_provider' => $sudo_provider, |
158 | | - 'selinux_provider' => $selinux_provider, |
159 | | - 'subdomains_provider' => $subdomains_provider, |
160 | | - 'autofs_provider' => $autofs_provider, |
161 | | - 'hostid_provider' => $hostid_provider, |
162 | | - 're_expression' => $re_expression, |
163 | | - 'full_name_format' => $full_name_format, |
164 | | - 'lookup_family_order' => $lookup_family_order, |
165 | | - 'dns_resolver_timeout' => $dns_resolver_timeout, |
166 | | - 'dns_discovery_domain' => $dns_discovery_domain, |
167 | | - 'override_gid' => $override_gid, |
168 | | - 'case_sensitive' => $case_sensitive, |
169 | | - 'proxy_fast_alias' => $proxy_fast_alias, |
170 | | - 'realmd_tags' => $realmd_tags, |
171 | | - 'proxy_pam_target' => $proxy_pam_target, |
172 | | - 'proxy_lib_name' => $proxy_lib_name, |
173 | | - 'ldap_user_search_filter' => $ldap_user_search_filter, |
174 | | - 'custom_options' => $custom_options, |
175 | | - }, |
176 | | - ), |
| 252 | + content => epp('sssd/domain.epp', { |
| 253 | + 'name' => $name, |
| 254 | + 'content' => $content, |
| 255 | + }), |
177 | 256 | } |
178 | 257 | } |
0 commit comments