summaryrefslogtreecommitdiff
path: root/sitemodules/profiles/manifests/debarchive.pp
blob: 2ad18be5a98efc28b9223ce81f9ad97a235efff1 (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
60
61
62
63
64
65
66
67
68
69
70
71
72
# Class: profiles::debarchive
# ===========================
#
# This class defines a mini-dinstall based Debian package archive setup.
#
# Parameters
# ----------
#
# @param uploaders a list of users that are allowed to dput files to the
#        Debian archive
#
# Examples
# --------
#
# @example
#   class 'roles::myhost' {
#     include profiles::debarchive
#   }
#
# Authors
# -------
#
# Jan Dittberner <jandd@cacert.org>
#
# Copyright
# ---------
#
# Copyright 2019 Jan Dittberner
#
class profiles::debarchive (
  Array[String] $uploaders = [],
) {
  include profiles::base

  package { 'mini-dinstall':
    ensure => latest,
  }
  group { 'debarchive':
    ensure => present,
    system => true,
  }
  user { 'debarchive':
    ensure  => present,
    comment => 'CAcert debian archive user',
    system  => true,
    group   => 'nogroup',
    home    => '/srv/debarchive',
    shell   => '/bin/false',
  }
  file { '/srv/debarchive':
    ensure => directory,
    owner  => 'debarchive',
    group  => 'debarchive',
    mode   => '0755',
  }
  file { '/srv/debarchive/mini-dinstall':
    ensure => directory,
    owner  => 'debarchive',
    group  => 'debarchive',
    mode   => '0755',
  }
  file { '/srv/debarchive/mini-dinstall/incoming':
    ensure => directory,
    owner  => 'debarchive',
    group  => 'debarchive',
    mode   => '0770',
  }

  $uploaders.each |String $username| {
    User<| title == $username |> { groups +> 'debarchive' }
  }
}