summaryrefslogtreecommitdiff
path: root/manifests/init.pp
blob: 1d7fd8296f0dabbc32a468faf93e5b508ef1f5f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Class: gitweb
#   Installs gitweb and configures apache to server it.
# Parameters:
#
# Actions:
#
# Requires:
#   - apache
#   - gitweb::settings
# Sample Usage:
#   include gitweb
class gitweb($site_alias, $doc_root, $project_root, $projects_list) {

  package { "gitweb":
    ensure  => present,
  }

  file { "/etc/gitweb.conf":
    ensure  => present,
    owner   => "root",
    group   => "root",
    mode    => "0644",
    content => template("gitweb/gitweb.conf.erb"),
    require => Package["gitweb"],
  }

  file { $doc_root:
    ensure => directory,
    owner  => 'git', # XXX,
    group  => 'git', # XXX,
    source => 'puppet:///modules/gitweb/html',
  }

  apache::vhost::redirect { $site_alias:
    port  => "80",
    dest  => "https://${site_alias}",
  }

  apache::vhost { "${site_alias}_ssl":
    priority      => "10",
    port          => "443",
    ssl           => true,
    docroot       => $doc_root,
    template      => "gitweb/apache-gitweb.conf.erb",
  }
}