From 4feb8c01c90bac83e04ef497da0ecebcf8dfa0e1 Mon Sep 17 00:00:00 2001
From: Matt Wise <matt@nextdoor.com>
Date: Wed, 21 Jan 2015 13:33:52 -0800
Subject: [PATCH] Add an optional content parameter to the freeradius::config
 resource.

This allows a user to use templates for their FreeRADIUS configuration
files rather than static files.
---
 README.md           | 6 ++++++
 manifests/config.pp | 4 +++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md
index d55fb99..3ccfd03 100644
--- a/README.md
+++ b/README.md
@@ -211,6 +211,12 @@ freeradius::config { 'realm-checks.conf':
 }
 ```
 
+```puppet
+freeradius::config { 'realm-checks.conf':
+  content => template('your_template),
+}
+```
+
 #### `freeradius::dictionary`
 
 Install custom dictionaries without breaking the default FreeRADIUS dictionary. Custom dictionaries are installed in `/etc/raddb/dictionary.d` and automatically included in the global dictionary.
diff --git a/manifests/config.pp b/manifests/config.pp
index 112b191..1da88ef 100644
--- a/manifests/config.pp
+++ b/manifests/config.pp
@@ -1,6 +1,7 @@
 # Install FreeRADIUS config snippets
 define freeradius::config (
-  $source,
+  $source = undef,
+  $content = undef,
   $ensure = present,
 ) {
   $fr_package  = $::freeradius::params::fr_package
@@ -14,6 +15,7 @@ define freeradius::config (
     owner   => 'root',
     group   => $fr_group,
     source  => $source,
+    content => $content,
     require => [File["${fr_basepath}/conf.d"], Package[$fr_package], Group[$fr_group]],
     notify  => Service[$fr_service],
   }
-- 
GitLab