summaryrefslogtreecommitdiff
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
parentCleanup whitespace. (diff)
downloadcgit-28563dfb5d21f24a927ca04648b3761f5da7ddcb.tar.gz
cgit-28563dfb5d21f24a927ca04648b3761f5da7ddcb.tar.xz
Change how root readme is sources.
-rw-r--r--files/root_readme30
-rw-r--r--manifests/init.pp25
2 files changed, 36 insertions, 19 deletions
diff --git a/files/root_readme b/files/root_readme
index aabf4df..6c648ce 100644
--- a/files/root_readme
+++ b/files/root_readme
@@ -1,17 +1,13 @@
- _______________________
-< Den som gör bestämmer >
- -----------------------
-\ . .
- \ / `. .' "
- \ .---. < > < > .---.
- \ | \ \ - ~ ~ - / / |
- _____ ..-~ ~-..-~
- | | \~~~\.' `./~~~/
- --------- \__/ \__/
- .' O \ / / \ "
- (_____, `._.' | } \/~~~/
- `----. / } | / \__/
- `-. | / | / `. ,~~|
- ~-.__| /_ - ~ ^| /- _ `..-'
- | / | / ~-. `-. _ _ _
- |_____| |_____| ~ - . _ _ _ _ _>
+ ___________________________________________________________________________________
+/ This file can be changed through two different parameters to ::cgit \
+| - root_readme_source, which corresponds to the source attribute of file resources |
+| - root_readme_content, which corresponds to the content attribute |
+\ The field root_readme_sha256 is also available, and does what you think it does. /
+ -----------------------------------------------------------------------------------
+ \
+ \
+ oO)-. .-(Oo
+ /__ _\ /_ __\
+ \ \( | ()~() | )/ /
+ \__|\ | (-___-) | /|__/
+ ' '--' ==`-'== '--' '
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):