From 28563dfb5d21f24a927ca04648b3761f5da7ddcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Tue, 11 Oct 2022 00:37:09 +0200 Subject: Change how root readme is sources. --- manifests/init.pp | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'manifests') 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): -- cgit v1.2.3