summaryrefslogtreecommitdiff
path: root/manifests/init.pp
diff options
context:
space:
mode:
Diffstat (limited to 'manifests/init.pp')
-rw-r--r--manifests/init.pp25
1 files changed, 23 insertions, 2 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index c4e5334..62cb2a3 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -3,6 +3,9 @@ class cgit (
String $filterpath = '/usr/lib/cgit/extra-filters',
String $root_title,
String $root_desc,
+ String $root_readme_source = "puppet:///modules/${module_name}/root_readme",
+ Optional[String] $root_readme_content = undef,
+ Optional[String] $root_readme_sha256 = undef,
String $about_filter,
String $auth_filter,
String $source_filter,
@@ -45,9 +48,27 @@ class cgit (
source => 'puppet:///modules/cgit/logo_large.png',
}
- file { "${root}/root_readme":
+ $chksum = if $root_readme_sha256 != undef {
+ {
+ 'checksum' => 'sha256',
+ 'checksum_value' => $root_readme_sha256,
+ }
+ } else {
+ { }
+ }
+
+ if $root_readme_content {
+ file { "${root}/root_readme":
+ ensure => file,
+ content => $root_readme_content,
+ * => $chksum,
+ }
+ } else {
+ file { "${root}/root_readme":
ensure => file,
- source => 'puppet:///modules/cgit/root_readme',
+ source => $root_readme_source,
+ * => $chksum,
+ }
}
file { dirname($filterpath):