summaryrefslogtreecommitdiff
path: root/modules/cgit/manifests/init.pp
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2021-12-29 20:13:55 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2021-12-29 20:13:55 +0100
commitd04542e000b8f8fadce45af96d93fb904ca99115 (patch)
treee85ee2bb0472d9f83f051f31d2629bf4c96bb755 /modules/cgit/manifests/init.pp
parentSetup new site.pp. (diff)
parentMigrate stuff from ansible. (diff)
downloadwebdav_server-d04542e000b8f8fadce45af96d93fb904ca99115.tar.gz
webdav_server-d04542e000b8f8fadce45af96d93fb904ca99115.tar.xz
Merge branch 'master' of /home/hugo/puppet into production
Diffstat (limited to 'modules/cgit/manifests/init.pp')
-rw-r--r--modules/cgit/manifests/init.pp62
1 files changed, 62 insertions, 0 deletions
diff --git a/modules/cgit/manifests/init.pp b/modules/cgit/manifests/init.pp
new file mode 100644
index 0000000..c1a981b
--- /dev/null
+++ b/modules/cgit/manifests/init.pp
@@ -0,0 +1,62 @@
+class cgit (
+ String $root = '/var/www/cgit',
+ String $filterpath = '/usr/lib/cgit/extra-filters',
+ String $root_title,
+ String $root_desc,
+ String $about_filter,
+ String $auth_filter,
+ String $source_filter,
+ String $scan_path,
+ Array[String] $clone_url,
+) {
+
+ # TODO figure out where CSS comes from
+
+ ensure_packages([
+ 'cgit',
+ ], { ensure => installed })
+
+ file { '/etc/cgitrc':
+ ensure => file,
+ content => epp('cgit/cgitrc.epp'),
+ }
+
+ file { "${root}/logo":
+ ensure => directory,
+ }
+
+ file { "${root}/logo/logo.png":
+ ensure => file,
+ source => 'puppet:///modules/cgit/logo.png',
+ }
+
+ file { "${root}/logo/logo_large.png":
+ ensure => file,
+ source => 'puppet:///modules/cgit/logo_large.png',
+ }
+
+ file { "${root}/root_readme":
+ ensure => file,
+ source => 'puppet:///modules/cgit/root_readme',
+ }
+
+ file { dirname($filterpath):
+ ensure => directory,
+ }
+
+ file { $filterpath:
+ ensure => directory,
+ }
+
+ [$about_filter, $source_filter, $auth_filter].each |$f| {
+ file { "${filterpath}/${f}":
+ ensure => file,
+ source => "puppet:///modules/cgit/filters/${f}",
+ mode => stdlib::extname($f) ? {
+ '.lua' => '0444',
+ default => '0555',
+ },
+ }
+ }
+
+}