introduce a way to pass content for includes
authormh <mh@immerda.ch>
Tue, 3 Aug 2010 21:11:06 +0000 (23:11 +0200)
committermh <mh@immerda.ch>
Tue, 3 Aug 2010 21:11:06 +0000 (23:11 +0200)
manifests/include.pp

index 0ab61b7..6e5a736 100644 (file)
@@ -1,11 +1,20 @@
-define squid::include(){
+define squid::include($content = undef){
   include ::squid
   require squid::includedir
 
   file{"/etc/squid/include.d/${name}":
-    source => [ "puppet:///modules/site-squid/include.d/${fqdn}/${name}",
-                "puppet:///modules/site-squid/include.d/${name}" ],
     notify => Service['squid'],
     owner => root, group => squid, mode => 0640;
   }
+
+  if !$content {
+    File["/etc/squid/include.d/${name}"]{
+      source => [ "puppet:///modules/site-squid/include.d/${fqdn}/${name}",
+                  "puppet:///modules/site-squid/include.d/${name}" ]
+    }
+  } else {
+    File["/etc/squid/include.d/${name}"]{
+      content => $content,
+    }
+  }
 }