Add new profile debarchive for webstatic
[cacert-puppet.git] / sitemodules / profiles / manifests / debarchive.pp
1 # Class: profiles::debarchive
2 # ===========================
3 #
4 # This class defines a mini-dinstall based Debian package archive setup.
5 #
6 # Parameters
7 # ----------
8 #
9 # @param uploaders a list of users that are allowed to dput files to the
10 # Debian archive
11 #
12 # Examples
13 # --------
14 #
15 # @example
16 # class 'roles::myhost' {
17 # include profiles::debarchive
18 # }
19 #
20 # Authors
21 # -------
22 #
23 # Jan Dittberner <jandd@cacert.org>
24 #
25 # Copyright
26 # ---------
27 #
28 # Copyright 2019 Jan Dittberner
29 #
30 class profiles::debarchive (
31 Array[String] $uploaders = [],
32 ) {
33 include profiles::base
34
35 package { 'mini-dinstall':
36 ensure => latest,
37 }
38 group { 'debarchive':
39 ensure => present,
40 system => true,
41 }
42 user { 'debarchive':
43 ensure => present,
44 comment => 'CAcert debian archive user',
45 system => true,
46 group => 'nogroup',
47 home => '/srv/debarchive',
48 shell => '/bin/false',
49 }
50 file { '/srv/debarchive':
51 ensure => directory,
52 owner => 'debarchive',
53 group => 'debarchive',
54 mode => '0755',
55 }
56 file { '/srv/debarchive/mini-dinstall':
57 ensure => directory,
58 owner => 'debarchive',
59 group => 'debarchive',
60 mode => '0755',
61 }
62 file { '/srv/debarchive/mini-dinstall/incoming':
63 ensure => directory,
64 owner => 'debarchive',
65 group => 'debarchive',
66 mode => '0770',
67 }
68
69 $uploaders.each |String $username| {
70 User<| title == $username |> { groups +> 'debarchive' }
71 }
72 }