From 731e675ef3944fc9679172ba933cfb97da1feabd Mon Sep 17 00:00:00 2001
From: Adam Henry Lewenberg <adamhl@stanford.edu>
Date: Tue, 30 Oct 2018 08:06:18 -0700
Subject: [PATCH] add the other_section_files parameter

---
 manifests/init.pp | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/manifests/init.pp b/manifests/init.pp
index c6287fd..9da6ab6 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -1,7 +1,16 @@
 #  $realms_additional
 #
-#  $other_sections:
+#  $other_sections: Additional sections that are formatted as key-value pairs (hash).
+#    Example:
+#      krb5conf::others_sections:
+#        kdc:
+#          log_file: SYSLOG:NOTICE
+#          acl_file: /etc/heimdal-kdc/kadmind.acl
+#          kdc_warn_pwexpire: 5d
+#
 #    Default = {}
+#
+#
 # Need a class. $name will be a file location.
 class krb5conf (
   Hash             $libdefaults,
@@ -15,6 +24,7 @@ class krb5conf (
   Optional[String] $appdefaults_file   = undef,
   Optional[String] $appdefaults_string = undef,
   Optional[Hash]   $other_sections = {},
+  Optional[Array]  $other_section_files = [],
 ) {
 
   if ($appdefaults_file and $appdefaults_string) {
@@ -43,12 +53,18 @@ class krb5conf (
   $other_section_strings =
     $other_sections.map |$section_name, $section_hash| { krb5conf::simple_hash_section($section_hash, $section_name) }
 
+  $other_section_files_strings =
+    $other_section_files.map |$other_section_file| { file($other_section_file) }
+  $other_section_files_string =
+    $other_section_files_strings.reduce |$memo, $value| { "${memo}\n${value}" }
+
   $all_sections = $other_section_strings +
   [
     $r_appdefaults_string,
     $libdefaults_string,
     $realms_string,
     $domain_realm_string,
+    $other_section_files_string,
     $logging_string,
   ]
 
-- 
GitLab