summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2012-10-21 12:03:40 +0200
committermh <mh@immerda.ch>2012-10-21 12:03:40 +0200
commit8b8747039d5312519815b590a5969641ef41b17c (patch)
tree1daf79b920bfe06664f0a042c9bacc1e91fe4310
parentbd7892775e041aec63d645547d9804526cf95839 (diff)
downloadpuppet-ejabberd-8b8747039d5312519815b590a5969641ef41b17c.tar.gz
puppet-ejabberd-8b8747039d5312519815b590a5969641ef41b17c.tar.bz2
make it possible to pass the config content, linting
-rw-r--r--manifests/base.pp28
-rw-r--r--manifests/init.pp2
2 files changed, 22 insertions, 8 deletions
diff --git a/manifests/base.pp b/manifests/base.pp
index 4b9f035..6eee36f 100644
--- a/manifests/base.pp
+++ b/manifests/base.pp
@@ -1,21 +1,33 @@
+# manages the basic stuff for the service
class ejabberd::base {
package{'ejabberd':
ensure => installed,
}
file{'/etc/ejabberd/ejabberd.cfg':
- source => [ "puppet:///modules/site_ejabberd/${::fqdn}/ejabberd.cfg",
- "puppet:///modules/site_ejabberd/ejabberd.cfg",
- "puppet:///modules/ejabberd/ejabberd.cfg" ],
require => Package['ejabberd'],
- notify => Service['ejabberd'],
- owner => root, group => ejabberd, mode => 0640;
+ notify => Service['ejabberd'],
+ owner => 'root',
+ group => 'ejabberd',
+ mode => '0640';
+ }
+
+ if $ejabberd::config_content {
+ File['/etc/ejabberd/ejabberd.cfg']{
+ content => $ejabberd::config_content
+ }
+ } else {
+ File['/etc/ejabberd/ejabberd.cfg']{
+ source => [ "puppet:///modules/site_ejabberd/${::fqdn}/ejabberd.cfg",
+ 'puppet:///modules/site_ejabberd/ejabberd.cfg',
+ 'puppet:///modules/ejabberd/ejabberd.cfg' ]
+ }
}
service{'ejabberd':
- ensure => running,
- enable => true,
+ ensure => running,
+ enable => true,
hasstatus => true,
- require => Package[ejabberd],
+ require => Package['ejabberd'],
}
}
diff --git a/manifests/init.pp b/manifests/init.pp
index 5ba015a..8c21344 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -2,8 +2,10 @@
# Copyright (C) 2007 admin@immerda.ch
# GPLv3
+# Manage an ejabberd server
class ejabberd(
$domains = $::fqdn,
+ $config_content = false,
$nagios_domain = $::fqdn,
$nagios_user = 'nagios',
$nagios_pwd = '',