diff options
author | Michael Stahnke <stahnma@puppetlabs.com> | 2012-10-18 18:34:22 -0700 |
---|---|---|
committer | Michael Stahnke <stahnma@puppetlabs.com> | 2012-10-18 18:34:22 -0700 |
commit | 7df35288388c2271b578e6686286ba46e2adf566 (patch) | |
tree | 8ea9b594d70f07cd4b1b496bccf9426319c469b2 | |
parent | f3f8eabdf1bc8d73dd8a5ede8f197fcd834d78ea (diff) | |
download | puppet-avahi-7df35288388c2271b578e6686286ba46e2adf566.tar.gz puppet-avahi-7df35288388c2271b578e6686286ba46e2adf566.tar.bz2 |
Adding params class
Signed-off-by: Michael Stahnke <stahnma@puppetlabs.com>
-rw-r--r-- | manifests/init.pp | 32 | ||||
-rw-r--r-- | manifests/params.pp | 18 |
2 files changed, 41 insertions, 9 deletions
diff --git a/manifests/init.pp b/manifests/init.pp index a9c7162..16980a4 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -21,25 +21,38 @@ # Copyright 2012 Michael Stahnke -class avahi { +class avahi inherits avahi::params { - $avahi_pkgs = [ 'avahi', 'avahi-tools', 'nss-mdns' ] - - package { $avahi_pkgs: +# $avahi_pkgs = [ 'avahi', 'avahi-tools', 'nss-mdns' ] +# $avahi_main = 'avahi' +# $avahi_daemon = 'avahi-daemon' +# $avahi_tools = 'avahi_tools' +# $avahi_mdns = 'nss-mdns' +# $avahi_dbus = 'dbus' or 'messagebus' +# + package { $avahi_main: + ensure => installed, + } + package { $avahi_tools: + ensure => installed, + require => Package[$avahi_main] + } + package { $avahi_mdns: ensure => installed, + require => Package[$avahi_main] } - service { 'avahi-daemon': + service { $avahi_daemon: ensure => running, enable => true, hasstatus => true, - require => Service['messagebus'], + require => Service[$avahi_dbus], } - service { 'messagebus': + service { $avahi_dbus: ensure => running, enable => true, - require => Package[$avahi_pkgs], + require => Package[$avahi_mdns], } ini_setting { "avahi-${::hostname}": @@ -49,7 +62,8 @@ class avahi { setting => 'host-name', key_val_separator => '=', value => $::hostname, - notify => Service['avahi-daemon'], + notify => Service[$avahi_daemon], + require => Package[$avahi_mdns], } } diff --git a/manifests/params.pp b/manifests/params.pp new file mode 100644 index 0000000..61a1753 --- /dev/null +++ b/manifests/params.pp @@ -0,0 +1,18 @@ +class avahi::params { + + if $::osfamily == 'RedHat' { + $avahi_main = 'avahi' + $avahi_daemon = 'avahi-daemon' + $avahi_tools = 'avahi-tools' + $avahi_mdns = 'nss-mdns' + $avahi_dbus = 'messagebus' + } + elsif $::osfamily == 'Debian' { + $avahi_main = 'avahi' + $avahi_daemon = 'avahi-daemon' + $avahi_tools = 'avahi-tools' + $avahi_mdns = 'nss-mdns' + $avahi_dbus = 'dbus' + } + +} |