diff options
author | Adrien Thebo <adrien@puppetlabs.com> | 2012-03-18 22:14:42 -0700 |
---|---|---|
committer | Adrien Thebo <adrien@puppetlabs.com> | 2012-03-18 22:14:42 -0700 |
commit | 4d392ec3685ec0a4b9778834051c65e57f6a19ce (patch) | |
tree | b344f31661bd753954cc296d2705d51b3fb584c6 | |
parent | 310948615959c1612da863935976f7d1106c96ec (diff) |
Better data handling in gitweb
-rw-r--r-- | manifests/init.pp | 19 | ||||
-rw-r--r-- | manifests/settings.pp | 17 | ||||
-rw-r--r-- | templates/gitweb.conf.erb | 4 |
3 files changed, 13 insertions, 27 deletions
diff --git a/manifests/init.pp b/manifests/init.pp index 801e3e5..1d7fd82 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -9,9 +9,7 @@ # - gitweb::settings # Sample Usage: # include gitweb -class gitweb { - - include gitweb::settings +class gitweb($site_alias, $doc_root, $project_root, $projects_list) { package { "gitweb": ensure => present, @@ -26,18 +24,23 @@ class gitweb { require => Package["gitweb"], } - A2mod <| title == "rewrite" |> + file { $doc_root: + ensure => directory, + owner => 'git', # XXX, + group => 'git', # XXX, + source => 'puppet:///modules/gitweb/html', + } - apache::vhost::redirect { "${gitweb::settings::site_alias}": + apache::vhost::redirect { $site_alias: port => "80", - dest => "https://${gitweb::settings::site_alias}", + dest => "https://${site_alias}", } - apache::vhost { "${gitweb::settings::site_alias}_ssl": + apache::vhost { "${site_alias}_ssl": priority => "10", port => "443", ssl => true, - docroot => "/var/www/git", + docroot => $doc_root, template => "gitweb/apache-gitweb.conf.erb", } } diff --git a/manifests/settings.pp b/manifests/settings.pp deleted file mode 100644 index 85c58dc..0000000 --- a/manifests/settings.pp +++ /dev/null @@ -1,17 +0,0 @@ -# Class: gitweb::settings -# Provides default values for gitweb and allows for overriding. -# -# Parameters: -# - site_alias: The site alias to make gitweb available -# - projectroot: The location where the git repositories are stored -# Actions: -# -# Requires: -# -# Sample Usage: -# -class gitweb::settings ( - $site_alias = "gitweb", - $projectroot = "/var/cache/git" -) { -} diff --git a/templates/gitweb.conf.erb b/templates/gitweb.conf.erb index 0731b69..366c3ce 100644 --- a/templates/gitweb.conf.erb +++ b/templates/gitweb.conf.erb @@ -1,5 +1,5 @@ # path to git projects (<project>.git) -$projectroot = "<%= scope.lookupvar('gitweb::settings::projectroot') %>"; +$projectroot = "<%= project_root %>"; # directory to use for temp files $git_temp = "/tmp"; @@ -11,7 +11,7 @@ $git_temp = "/tmp"; $home_text = "indextext.html"; # file with project list; by default, simply scan the projectroot dir. -$projects_list = $projectroot; +$projects_list = "<%= projects_list %>"; # stylesheet to use $stylesheet = "/gitweb/gitweb.css"; |