summaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2022-10-11 00:37:09 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2022-10-11 01:16:10 +0200
commit28563dfb5d21f24a927ca04648b3761f5da7ddcb (patch)
tree8155113d23cce9f7c25da6f32db6da0faf342944 /manifests
parentCleanup whitespace. (diff)
downloadcgit-28563dfb5d21f24a927ca04648b3761f5da7ddcb.tar.gz
cgit-28563dfb5d21f24a927ca04648b3761f5da7ddcb.tar.xz
Change how root readme is sources.
Diffstat (limited to 'manifests')
-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):