weblate.pp 1.63 KB
Newer Older
intrigeri's avatar
intrigeri committed
1
# Manage a Weblate service
intrigeri's avatar
intrigeri committed
2
class tails::weblate (
3
  String $postgres_password,
4
  String $weblate_admin_password,
5
  String $weblate_secret_key,
6
  String $redis_password,
7
  Array[String] $podman_extra_volumes = [],  # Used for testing purposes.
8
) inherits tails::weblate::params {
9

intrigeri's avatar
intrigeri committed
10
11
  ### Sanity checks

12
13
  if $::lsbdistcodename != 'bullseye' {
    fail('The tails::weblate class only supports Debian Bullseye.')
intrigeri's avatar
intrigeri committed
14
15
  }

16
  ### Operating system configurations
groente's avatar
groente committed
17

18
  include tails::weblate::users_and_groups
19

20
21
  ensure_packages(['grep'])

22
  ### Weblate configuration
23

24
25
26
27
  file { $weblate_data_dir:
    ensure => directory,
    owner  => $ns_weblate_uid,
    group  => $ns_root_gid,
28
    mode   => '2755',
29
30
  }

31
  include tails::weblate::webserver
32

33
34
  class { 'tails::weblate::database':
    postgres_password => $postgres_password,
35
36
  }

37
38
  class { 'tails::weblate::redis':
    redis_password => $redis_password,
39
40
  }

41
42
  include tails::weblate::repositories
  Class['tails::weblate::users_and_groups'] -> Class['tails::weblate::repositories']
43

44
45
46
  include tails::weblate::config
  include tails::weblate::logs
  include tails::weblate::tmserver
47

48
  class { 'tails::weblate::podman':
49
    redis_password         => $redis_password,
50
    postgres_password      => $postgres_password,
51
52
53
54
    weblate_admin_password => $weblate_admin_password,
    weblate_secret_key     => $weblate_secret_key,
    extra_volumes          => $podman_extra_volumes,
    require                => [
55
56
57
      Class['tails::weblate::users_and_groups'],
      Class['tails::weblate::repositories'],
    ]
58
59
  }

60
61
  ### Integration with Tails website

62
63
  include tails::weblate::scripts
  include tails::weblate::staging_website
intrigeri's avatar
intrigeri committed
64

intrigeri's avatar
intrigeri committed
65
}