diff options
author | mh <mh@immerda.ch> | 2012-10-21 12:03:40 +0200 |
---|---|---|
committer | mh <mh@immerda.ch> | 2012-10-21 12:03:40 +0200 |
commit | 8b8747039d5312519815b590a5969641ef41b17c (patch) | |
tree | 1daf79b920bfe06664f0a042c9bacc1e91fe4310 | |
parent | bd7892775e041aec63d645547d9804526cf95839 (diff) | |
download | puppet-ejabberd-8b8747039d5312519815b590a5969641ef41b17c.tar.gz puppet-ejabberd-8b8747039d5312519815b590a5969641ef41b17c.tar.bz2 |
make it possible to pass the config content, linting
-rw-r--r-- | manifests/base.pp | 28 | ||||
-rw-r--r-- | manifests/init.pp | 2 |
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 = '', |