summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2013-06-05 22:50:40 +0200
committermh <mh@immerda.ch>2013-06-05 22:50:40 +0200
commita29937282df1bb51a69e5c0525f3bf4b5b435fe9 (patch)
tree729c3324c77cb2dff9dee1ec99924142b0d1b66c
parentfd30d893e543c35207f33482a3b84f7d66f5390b (diff)
downloadpuppet-mumble-a29937282df1bb51a69e5c0525f3bf4b5b435fe9.tar.gz
puppet-mumble-a29937282df1bb51a69e5c0525f3bf4b5b435fe9.tar.bz2
make it possible to pass config content
-rw-r--r--manifests/init.pp41
1 files changed, 27 insertions, 14 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index 9de9364..85865dc 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -1,24 +1,37 @@
# setup mumble
-class mumble {
- package { 'mumble-server':
+#
+# Parameters:
+#
+# * config_content: get content for central config file from
+# this parameter. Useful for using templates
+# * config_source: Source path for your config
+#
+class mumble(
+ $config_content = false,
+ $config_source = [ "puppet:///modules/site_mumble/${::fqdn}/mumble-server.ini",
+ "puppet:///modules/site_mumble/mumble-server.ini",
+ "puppet:///modules/mumble/mumble-server.ini" ],
+) {
+ package{'mumble-server':
ensure => installed,
- }
-
- service { 'mumble-server':
+ } -> file{'/etc/mumble-server.ini':
+ owner => root,
+ group => mumble-server,
+ mode => 0640;
+ } ~> service{'mumble-server':
ensure => 'running',
enable => true,
hasstatus => false,
pattern => '/usr/sbin/murmurd',
}
- file{'/etc/mumble-server.ini':
- source => [ "puppet:///modules/site_mumble/${::fqdn}/mumble-server.ini",
- "puppet:///modules/site_mumble/mumble-server.ini",
- "puppet:///modules/mumble/mumble-server.ini" ],
- require => Package['mumble-server'],
- notify => Service['mumble-server'],
- owner => root,
- group => mumble-server,
- mode => 0640;
+ if $config_content {
+ File['/etc/mumble-server.ini']{
+ content => $config_content,
+ }
+ } else {
+ File['/etc/mumble-server.ini']{
+ source => $config_source,
+ }
}
}