Skip to content

Commit bd4bec0

Browse files
committed
Refactor to use common templates
1 parent bf02294 commit bd4bec0

File tree

28 files changed

+43
-105
lines changed

28 files changed

+43
-105
lines changed

manifests/config.pp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@
132132
owner => 'root',
133133
group => 'root',
134134
mode => '0600',
135-
content => epp("${module_name}/sssd.conf.epp", {
136-
'content' => $content,
135+
content => epp("${module_name}/content_only.epp", {
136+
'content' => "# sssd::config\n[sssd]\n${content}",
137137
}),
138138
notify => Class["${module_name}::service"],
139139
}

manifests/domain.pp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,9 +249,9 @@
249249
$content = $config_lines.join("\n")
250250

251251
sssd::config::entry { "puppet_domain_${name}":
252-
content => epp('sssd/domain.epp', {
253-
'name' => $name,
254-
'content' => $content,
252+
content => epp("${module_name}/generic", {
253+
'title' => "domain/${name}",
254+
'content' => "# sssd::domain ${name}\n${content}",
255255
}),
256256
}
257257
}

manifests/provider/ad.pp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -373,9 +373,9 @@
373373
$content = $config_lines.join("\n")
374374

375375
sssd::config::entry { "puppet_provider_${name}_ad":
376-
content => epp("${module_name}/provider/ad.epp", {
377-
'title' => $title,
378-
'content' => $content,
376+
content => epp("${module_name}/generic.epp", {
377+
'title' => "domain/${title}",
378+
'content' => "# sssd::provider::ad\n${content}",
379379
}),
380380
}
381381
}

manifests/provider/files.pp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@
4242
# Combine all configuration entries
4343
$_all_entries = $_content + $_passwd_files_entries + $_group_files_entries
4444

45-
$_final_content = $_all_entries.join("\n")
45+
$_final_content = "${_all_entries.join("\n")}"
4646

4747
sssd::config::entry { "puppet_provider_${name}_files":
4848
content => epp(
49-
"${module_name}/provider/files.epp",
49+
"${module_name}/generic.epp",
5050
{
5151
'title' => "domain/${title}",
5252
'content' => $_final_content,

manifests/provider/ipa.pp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,12 +156,12 @@
156156
)
157157

158158
# Join all configuration lines
159-
$content = $config_lines.join("\n")
159+
$_final_content = $config_lines.join("\n")
160160

161161
sssd::config::entry { "puppet_provider_${name}_ipa":
162-
content => epp("${module_name}/provider/ipa.epp", {
163-
'title' => $title,
164-
'content' => $content,
162+
content => epp("${module_name}/generic.epp", {
163+
'title' => "domain/${title}",
164+
'content' => "# sssd::provider::ipa\n${_final_content}",
165165
}),
166166
}
167167
}

manifests/provider/krb5.pp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,11 @@
134134
# Combine all configuration entries in the expected order
135135
$_all_entries = $_content + $_debug_level_entries + $_debug_timestamps_entries + $_debug_microseconds_entries + $_krb5_server_entries + $_krb5_realm_entries + $_krb5_kpasswd_entries + $_krb5_ccachedir_entries + $_krb5_ccname_template_entries + $_krb5_auth_timeout_entries + $_krb5_validate_entries + $_krb5_keytab_entries + $_krb5_store_password_if_offline_entries + $_krb5_renewable_lifetime_entries + $_krb5_lifetime_entries + $_krb5_renew_interval_entries + $_krb5_use_fast_entries
136136

137-
$_final_content = $_all_entries.join("\n")
137+
$_final_content = "${_all_entries.join("\n")}"
138138

139139
sssd::config::entry { "puppet_provider_${name}_krb5":
140140
content => epp(
141-
"${module_name}/provider/krb5",
141+
"${module_name}/generic.epp",
142142
{
143143
'title' => "domain/${title}",
144144
'content' => $_final_content,

manifests/provider/ldap.pp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -709,14 +709,14 @@
709709

710710
# Combine all configuration lines and sort them
711711
$all_config_lines = ($simple_config_lines + $account_expire_line + $array_config_lines).sort
712-
$content = $all_config_lines.join("\n")
712+
$content = "${all_config_lines.join("\n")}"
713713

714714
sssd::config::entry { "puppet_provider_${title}_ldap":
715715
content => epp(
716-
"${module_name}/provider/ldap.epp",
716+
"${module_name}/generic.epp",
717717
{
718-
'title' => $title,
719-
'content' => $content,
718+
'title' => "domain/${title}",
719+
'content' => "# sssd::provider::ldap\n${content}",
720720
},
721721
),
722722
}

manifests/service/autofs.pp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@
7575
# Combine all configuration entries in the expected order
7676
$_all_entries = $_base_content + $_description_entries + $_debug_level_entries + $_debug_timestamps_entries + $_debug_microseconds_entries + $_autofs_negative_timeout_entries
7777

78-
$_final_content = $_all_entries.join("\n")
78+
$_final_content = "${_all_entries.join("\n")}"
7979

8080
$_content = epp(
81-
"${module_name}/service/autofs.epp",
81+
"${module_name}/content_only.epp",
8282
{
8383
'content' => $_final_content,
8484
},

manifests/service/ifp.pp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,10 @@
9292
# Combine all configuration entries in the expected order
9393
$_all_entries = $_base_content + $_description_entries + $_debug_level_entries + $_debug_timestamps_entries + $_debug_microseconds_entries + $_allowed_uids_entries + $_user_attributes_entries + $_wildcard_limit_entries
9494

95-
$_final_content = $_all_entries.join("\n")
95+
$_final_content = "${_all_entries.join("\n")}"
9696

9797
$_content = epp(
98-
"${module_name}/service/ifp.epp",
98+
"${module_name}/content_only.epp",
9999
{
100100
'content' => $_final_content,
101101
},

manifests/service/nss.pp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,13 @@
135135
# Join all configuration lines
136136
$content = $config_lines.join("\n")
137137

138-
$_content = epp("${module_name}/service/nss.epp", {
139-
'content' => $content,
140-
})
138+
$_content = epp(
139+
"${module_name}/generic.epp",
140+
{
141+
'title' => 'nss',
142+
'content' => "# sssd::service::nss\n${content}",
143+
},
144+
)
141145
}
142146

143147
sssd::config::entry { 'puppet_service_nss':

0 commit comments

Comments
 (0)