From 7df35288388c2271b578e6686286ba46e2adf566 Mon Sep 17 00:00:00 2001 From: Michael Stahnke Date: Thu, 18 Oct 2012 18:34:22 -0700 Subject: Adding params class Signed-off-by: Michael Stahnke --- manifests/init.pp | 32 +++++++++++++++++++++++--------- manifests/params.pp | 18 ++++++++++++++++++ 2 files changed, 41 insertions(+), 9 deletions(-) create mode 100644 manifests/params.pp 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' + } + +} -- cgit v1.2.3