Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: modules/adblockplus/manifests/mumble.pp

Issue 29517747: #1645 - Introduce mumble module (Closed)
Patch Set: Created Aug. 16, 2017, 7:01 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 # == Class: adblockplus:mumble
2 #
3 # Create and maintain mumble (https://www.mumble.com) setups.
4 #
5 # === Parameters:
6 #
7 # [*package*]
8 # Overwrite the default package options, to fine-tune the target version (i.e.
9 # ensure => 'latest') or remove mumble (ensure => 'absent' or 'purged')
10 #
11 # === Hiera (only) Parameters:
mathias 2017/08/24 06:23:07 Why Hiera only?
f.lopez 2017/08/25 19:04:40 Well, I wanted to use it with hiera only, but yeah
12 #
13 # [*certificate*]
14 # Certificate used to enable SSL connection with the server.
15 #
16 # [*private_key*]
17 # Private key used to enable SSL connection with the client.
18 #
19 # [*server_password*]
20 # String used to login into the server.
21 #
22 #
23 # === Examples:
24 #
25 # class {'adblockplus::mumble':
26 # package => {
27 # 'ensure' => 'absent',
28 # },
29 # },
30 # }
31 #
32 class adblockplus::mumble (
33 $package = {},
34 ){
35
36 if ensure_state($ensure) {
mathias 2017/08/24 06:23:07 The $ensure parameter is always undefined at this
f.lopez 2017/08/25 19:04:40 Acknowledged.
37 $ensure = 'present'
38 }
39 else {
40 $ensure = 'absent'
41 }
42
43 $certificate = hiera('adblockplus::mumble::certificate', undef)
44 $private_key = hiera('adblockplus::mumble::private_key', undef)
45 $server_password = hiera('adblockplus::mumble::server_password', undef)
46
47 ensure_resource('package', $title, merge({
48 name => 'mumble-server',
49 ensure => $ensure,
50 }, $package))
51
52 file{"/etc/mumble-server.ini":
53 owner => 'root',
54 group => 'mumble-server',
55 mode => 0640,
56 content => template('adblockplus/mumble-server.ini.erb'),
57 require => Package[$title],
58 notify => Service['mumble-server'],
59 }
60
61 service{'mumble-server':
62 ensure => 'running',
63 enable => true,
64 require => Package[$title],
65 }
66
67 if $mumble::certificate and $mumble::private_key {
mathias 2017/08/24 06:23:07 Please do not replicate the legacy "give me the na
f.lopez 2017/08/25 19:04:40 Ok fair enough, working on this. Gonna send a new
68 file {"/etc/mumble.crt":
69 ensure => 'file',
70 mode => 0644,
71 group => 'mumble-server',
72 before => File["/etc/mumble-server.ini"],
73 require => Package[$title],
74 source => "puppet:///modules/private/${mumble::certificate}",
75 }
76
77 file {"/etc/mumble.key":
78 ensure => 'file',
79 mode => 0644,
80 group => 'mumble-server',
81 before => File["/etc/mumble-server.ini"],
82 require => Package[$title],
83 source => "puppet:///modules/private/${mumble::private_key}",
84 }
85 }
86 }
87
OLDNEW

Powered by Google App Engine
This is Rietveld