|
39 | 39 | }, |
40 | 40 | ) |
41 | 41 | } else { |
| 42 | + # Build configuration content for the SSH service |
| 43 | + $_base_content = [ |
| 44 | + '# sssd::service::ssh', |
| 45 | + '[ssh]', |
| 46 | + ] |
| 47 | + |
| 48 | + # Add conditional parameters if defined |
| 49 | + if $description { |
| 50 | + $_description_entries = ["description = ${description}"] |
| 51 | + } else { |
| 52 | + $_description_entries = [] |
| 53 | + } |
| 54 | + |
| 55 | + if $debug_level { |
| 56 | + $_debug_level_entries = ["debug_level = ${debug_level}"] |
| 57 | + } else { |
| 58 | + $_debug_level_entries = [] |
| 59 | + } |
| 60 | + |
| 61 | + $_debug_timestamps_entries = $debug_timestamps ? { |
| 62 | + true => ['debug_timestamps = true'], |
| 63 | + false => ['debug_timestamps = false'], |
| 64 | + } |
| 65 | + |
| 66 | + $_debug_microseconds_entries = $debug_microseconds ? { |
| 67 | + true => ['debug_microseconds = true'], |
| 68 | + false => ['debug_microseconds = false'], |
| 69 | + } |
| 70 | + |
| 71 | + $_ssh_hash_known_hosts_entries = $ssh_hash_known_hosts ? { |
| 72 | + true => ['ssh_hash_known_hosts = true'], |
| 73 | + false => ['ssh_hash_known_hosts = false'], |
| 74 | + } |
| 75 | + |
| 76 | + if $ssh_known_hosts_timeout { |
| 77 | + $_ssh_known_hosts_timeout_entries = ["ssh_known_hosts_timeout = ${ssh_known_hosts_timeout}"] |
| 78 | + } else { |
| 79 | + $_ssh_known_hosts_timeout_entries = [] |
| 80 | + } |
| 81 | + |
| 82 | + # Combine all configuration entries in the expected order |
| 83 | + $_all_entries = $_base_content + $_description_entries + $_debug_level_entries + $_debug_timestamps_entries + $_debug_microseconds_entries + $_ssh_hash_known_hosts_entries + $_ssh_known_hosts_timeout_entries |
| 84 | + |
| 85 | + $_final_content = $_all_entries.join("\n") |
| 86 | + |
42 | 87 | $_content = epp( |
43 | 88 | "${module_name}/service/ssh.epp", |
44 | 89 | { |
45 | | - 'description' => $description, |
46 | | - 'debug_level' => $debug_level, |
47 | | - 'debug_timestamps' => $debug_timestamps, |
48 | | - 'debug_microseconds' => $debug_microseconds, |
49 | | - 'ssh_hash_known_hosts' => $ssh_hash_known_hosts, |
50 | | - 'ssh_known_hosts_timeout' => $ssh_known_hosts_timeout, |
| 90 | + 'content' => $_final_content, |
51 | 91 | }, |
52 | 92 | ) |
53 | 93 | } |
|
0 commit comments