summaryrefslogtreecommitdiff
path: root/manifests/init.pp
diff options
context:
space:
mode:
Diffstat (limited to 'manifests/init.pp')
-rw-r--r--manifests/init.pp46
1 files changed, 19 insertions, 27 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index 62cb2a3..bbd8edb 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -1,6 +1,6 @@
class cgit (
String $root = '/var/www/cgit',
- String $filterpath = '/usr/lib/cgit/extra-filters',
+ String $filterpath = '/usr/lib/cgit/puppet-controlled-filters',
String $root_title,
String $root_desc,
String $root_readme_source = "puppet:///modules/${module_name}/root_readme",
@@ -20,6 +20,8 @@ class cgit (
Optional[String] $server_name = undef,
Optional[String] $certname = undef,
String $htpasswd = '/var/lib/nginx/cgit-htpasswd',
+ String $cgitrc = '/etc/cgitrc',
+ Hash[String, Hash] $filters = {},
) {
# TODO figure out where CSS comes from
@@ -29,11 +31,24 @@ class cgit (
'cgit',
], { ensure => installed })
- file { '/etc/cgitrc':
- ensure => file,
- content => epp('cgit/cgitrc.epp'),
+
+ concat { $cgitrc:
+ ensure => present,
+ }
+ concat::fragment { 'cgit config upper half':
+ order => 0,
+ content => epp('cgit/upper.epp'),
+ target => $::cgit::cgitrc,
+ }
+
+ concat::fragment { 'cgit config lower half':
+ order => 99,
+ content => epp('cgit/lower.epp'),
+ target => $::cgit::cgitrc,
}
+ create_resources(git::filter, $filters)
+
file { "${root}/logo":
ensure => directory,
}
@@ -71,30 +86,7 @@ class cgit (
}
}
- file { dirname($filterpath):
- ensure => directory,
- }
- file { $filterpath:
- ensure => directory,
- }
-
- [$about_filter, $source_filter].each |$f| {
- file { "${filterpath}/${f}":
- ensure => file,
- source => "puppet:///modules/cgit/filters/${f}",
- mode => stdlib::extname($f) ? {
- '.lua' => '0444',
- default => '0555',
- },
- }
- }
-
- file { "${filterpath}/${auth_filter}":
- ensure => file,
- content => epp("cgit/${auth_filter}.epp"),
- mode => '0444',
- }
if $manage_server {
if $server_name == undef {