|
61 | 61 | }, |
62 | 62 | ) |
63 | 63 | } else { |
| 64 | + # Build configuration content for the PAM service |
| 65 | + $_base_content = [ |
| 66 | + '# sssd::service::pam', |
| 67 | + ] |
| 68 | + |
| 69 | + # Add conditional parameters if defined |
| 70 | + if $description { |
| 71 | + $_description_entries = ["description = ${description}"] |
| 72 | + } else { |
| 73 | + $_description_entries = [] |
| 74 | + } |
| 75 | + |
| 76 | + if $debug_level { |
| 77 | + $_debug_level_entries = ["debug_level = ${debug_level}"] |
| 78 | + } else { |
| 79 | + $_debug_level_entries = [] |
| 80 | + } |
| 81 | + |
| 82 | + $_debug_timestamps_entries = $debug_timestamps ? { |
| 83 | + true => ['debug_timestamps = true'], |
| 84 | + false => ['debug_timestamps = false'], |
| 85 | + } |
| 86 | + |
| 87 | + $_debug_microseconds_entries = $debug_microseconds ? { |
| 88 | + true => ['debug_microseconds = true'], |
| 89 | + false => ['debug_microseconds = false'], |
| 90 | + } |
| 91 | + |
| 92 | + $_reconnection_retries_entries = ["reconnection_retries = ${reconnection_retries}"] |
| 93 | + |
| 94 | + if $command { |
| 95 | + $_command_entries = ["command = ${command}"] |
| 96 | + } else { |
| 97 | + $_command_entries = [] |
| 98 | + } |
| 99 | + |
| 100 | + $_offline_credentials_expiration_entries = ["offline_credentials_expiration = ${offline_credentials_expiration}"] |
| 101 | + $_offline_failed_login_attempts_entries = ["offline_failed_login_attempts = ${offline_failed_login_attempts}"] |
| 102 | + $_offline_failed_login_delay_entries = ["offline_failed_login_delay = ${offline_failed_login_delay}"] |
| 103 | + $_pam_verbosity_entries = ["pam_verbosity = ${pam_verbosity}"] |
| 104 | + $_pam_id_timeout_entries = ["pam_id_timeout = ${pam_id_timeout}"] |
| 105 | + $_pam_pwd_expiration_warning_entries = ["pam_pwd_expiration_warning = ${pam_pwd_expiration_warning}"] |
| 106 | + |
| 107 | + if $get_domains_timeout { |
| 108 | + $_get_domains_timeout_entries = ["get_domains_timeout = ${get_domains_timeout}"] |
| 109 | + } else { |
| 110 | + $_get_domains_timeout_entries = [] |
| 111 | + } |
| 112 | + |
| 113 | + if $pam_trusted_users { |
| 114 | + $_pam_trusted_users_entries = ["pam_trusted_users = ${pam_trusted_users}"] |
| 115 | + } else { |
| 116 | + $_pam_trusted_users_entries = [] |
| 117 | + } |
| 118 | + |
| 119 | + if $pam_public_domains { |
| 120 | + $_pam_public_domains_entries = ["pam_public_domains = ${pam_public_domains}"] |
| 121 | + } else { |
| 122 | + $_pam_public_domains_entries = [] |
| 123 | + } |
| 124 | + |
| 125 | + $_pam_cert_auth_entries = $pam_cert_auth ? { |
| 126 | + true => ['pam_cert_auth = True'], |
| 127 | + false => [], |
| 128 | + } |
| 129 | + |
| 130 | + # Combine all configuration entries in the expected order |
| 131 | + $_all_entries = $_base_content + $_description_entries + $_debug_level_entries + $_debug_timestamps_entries + $_debug_microseconds_entries + $_reconnection_retries_entries + $_command_entries + $_offline_credentials_expiration_entries + $_offline_failed_login_attempts_entries + $_offline_failed_login_delay_entries + $_pam_verbosity_entries + $_pam_id_timeout_entries + $_pam_pwd_expiration_warning_entries + $_get_domains_timeout_entries + $_pam_trusted_users_entries + $_pam_public_domains_entries + $_pam_cert_auth_entries |
| 132 | + |
| 133 | + $_final_content = $_all_entries.join("\n") |
| 134 | + |
64 | 135 | $_content = epp( |
65 | 136 | "${module_name}/service/pam.epp", |
66 | 137 | { |
67 | | - 'description' => $description, |
68 | | - 'debug_level' => $debug_level, |
69 | | - 'debug_timestamps' => $debug_timestamps, |
70 | | - 'debug_microseconds' => $debug_microseconds, |
71 | | - 'pam_cert_auth' => $pam_cert_auth, |
72 | | - 'reconnection_retries' => $reconnection_retries, |
73 | | - 'command' => $command, |
74 | | - 'offline_credentials_expiration' => $offline_credentials_expiration, |
75 | | - 'offline_failed_login_attempts' => $offline_failed_login_attempts, |
76 | | - 'offline_failed_login_delay' => $offline_failed_login_delay, |
77 | | - 'pam_verbosity' => $pam_verbosity, |
78 | | - 'pam_id_timeout' => $pam_id_timeout, |
79 | | - 'pam_pwd_expiration_warning' => $pam_pwd_expiration_warning, |
80 | | - 'get_domains_timeout' => $get_domains_timeout, |
81 | | - 'pam_trusted_users' => $pam_trusted_users, |
82 | | - 'pam_public_domains' => $pam_public_domains, |
| 138 | + 'content' => $_final_content, |
83 | 139 | }, |
84 | 140 | ) |
85 | 141 | } |
|
0 commit comments