aboutsummaryrefslogtreecommitdiff
path: root/manifests/cgit.pp
blob: f1d12e2a4f58263184791d6f061fcf628291b22e (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
47
48
49
50
51
52
53
54
55
56
57
58
59
class git::cgit(
  $css                = '/cgit-css/cgit.css',
  $logo               = '/cgit.png',
  $root_title         = 'Git Repository Browser',
  $root_desc          = 'a fast webinterface for the git dscm',
  $clone_url          = 'https://$HTTP_HOST$SCRIPT_NAME/$CGIT_REPO_URL git://$HTTP_HOST$SCRIPT_NAME/$CGIT_REPO_URL git@$HTTP_HOST:$CGIT_REPO_URL',
  $cache_about_ttl    = '15',
  $cache_dynamic_ttl  = '5',
  $cache_repo_ttl     = '5',
  $cache_root         = '/var/cache/cgit',
  $cache_root_ttl     = '5',
  $cache_scanrc_ttl   = '5',
  $cache_size         = '0',
  $cache_snapshot_ttl = '5',
  $cache_static_ttl   = '-1',
  $enable_git_clone   = '1',
  $enable_http_clone  = '1',
  $enable_index_links = '1',
  $source_filter      = '/usr/lib/cgit/filters/syntax_highlighting.py',
  $about_filter       = '/usr/lib/cgit/filters/about_formatting.sh',
  $enable_git_config  = '1',
  $remove_suffix      = '1',
) {
  package { 'cgit':
    ensure  => $::lsbdistcodename ? {
      'wheezy' => absent,
      default  => present,
    }
  }

  # Old python2 dependencies
  #package { [ 'python-pygments', 'python-markdown' ]:
  #  ensure => present,
  #}

  # For synthax highlighting
  package { [ 'python3-pygments', 'python3-markdown' ]:
    ensure => present,
  }

  file { '/etc/cgitrc':
    owner   => "root",
    group   => "root",
    mode    => '0644',
    ensure  => present,
    content => template('git/cgitrc.erb'),
  }

  file { '/var/git/cgit':
    ensure  => directory,
    recurse => true,
    purge   => true,
    force   => true,
    owner   => "git",
    group   => "git",
    source  => "puppet:///modules/git/cgit/",
    require => File['/var/git'],
  }
}