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

Unified Diff: modules/adblockplus/manifests/mumble.pp

Issue 29517747: #1645 - Introduce mumble module (Closed)
Patch Set: Created Aug. 16, 2017, 7:01 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: modules/adblockplus/manifests/mumble.pp
===================================================================
new file mode 100644
--- /dev/null
+++ b/modules/adblockplus/manifests/mumble.pp
@@ -0,0 +1,87 @@
+# == Class: adblockplus:mumble
+#
+# Create and maintain mumble (https://www.mumble.com) setups.
+#
+# === Parameters:
+#
+# [*package*]
+# Overwrite the default package options, to fine-tune the target version (i.e.
+# ensure => 'latest') or remove mumble (ensure => 'absent' or 'purged')
+#
+# === 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
+#
+# [*certificate*]
+# Certificate used to enable SSL connection with the server.
+#
+# [*private_key*]
+# Private key used to enable SSL connection with the client.
+#
+# [*server_password*]
+# String used to login into the server.
+#
+#
+# === Examples:
+#
+# class {'adblockplus::mumble':
+# package => {
+# 'ensure' => 'absent',
+# },
+# },
+# }
+#
+class adblockplus::mumble (
+ $package = {},
+){
+
+ 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.
+ $ensure = 'present'
+ }
+ else {
+ $ensure = 'absent'
+ }
+
+ $certificate = hiera('adblockplus::mumble::certificate', undef)
+ $private_key = hiera('adblockplus::mumble::private_key', undef)
+ $server_password = hiera('adblockplus::mumble::server_password', undef)
+
+ ensure_resource('package', $title, merge({
+ name => 'mumble-server',
+ ensure => $ensure,
+ }, $package))
+
+ file{"/etc/mumble-server.ini":
+ owner => 'root',
+ group => 'mumble-server',
+ mode => 0640,
+ content => template('adblockplus/mumble-server.ini.erb'),
+ require => Package[$title],
+ notify => Service['mumble-server'],
+ }
+
+ service{'mumble-server':
+ ensure => 'running',
+ enable => true,
+ require => Package[$title],
+ }
+
+ 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
+ file {"/etc/mumble.crt":
+ ensure => 'file',
+ mode => 0644,
+ group => 'mumble-server',
+ before => File["/etc/mumble-server.ini"],
+ require => Package[$title],
+ source => "puppet:///modules/private/${mumble::certificate}",
+ }
+
+ file {"/etc/mumble.key":
+ ensure => 'file',
+ mode => 0644,
+ group => 'mumble-server',
+ before => File["/etc/mumble-server.ini"],
+ require => Package[$title],
+ source => "puppet:///modules/private/${mumble::private_key}",
+ }
+ }
+}
+

Powered by Google App Engine
This is Rietveld