From 849c20ec690897400551da053bc100b4d9cdb347 Mon Sep 17 00:00:00 2001 From: Michael Stahnke Date: Sun, 28 Oct 2012 16:04:36 -0700 Subject: Do not attempt to do avahi stuff on non-linux Prior to this commit, avahi would be applied to any node including the avahi class. This is great until you have a mac check in and there is not avahi package in any way. So, I have now constrained the module to only run on Linux clients, even if included elsewhere. Signed-off-by: Michael Stahnke --- manifests/init.pp | 68 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 35 insertions(+), 33 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index c5bca58..cbd21aa 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -22,43 +22,45 @@ class avahi inherits avahi::params { - package { $avahi_main: - ensure => installed, - } + if $::kernel == 'Linux' { - package { $avahi_tools: - ensure => installed, - require => Package[$avahi_main] - } + package { $avahi_main: + ensure => installed, + } - package { $avahi_mdns: - ensure => installed, - require => Package[$avahi_main] - } + package { $avahi_tools: + ensure => installed, + require => Package[$avahi_main] + } - service { $avahi_daemon: - ensure => running, - enable => true, - hasstatus => true, - require => Service['avahi_dbus'], - } + package { $avahi_mdns: + ensure => installed, + require => Package[$avahi_main] + } - service { 'avahi_dbus': - name => $avahi_dbus, - ensure => running, - enable => true, - require => Package[$avahi_mdns], - } + service { $avahi_daemon: + ensure => running, + enable => true, + hasstatus => true, + require => Service['avahi_dbus'], + } - ini_setting { "avahi-${::hostname}": - ensure => present, - path => '/etc/avahi/avahi-daemon.conf', - section => 'server', - setting => 'host-name', - key_val_separator => '=', - value => $::hostname, - notify => Service[$avahi_daemon], - require => Package[$avahi_mdns], - } + service { 'avahi_dbus': + name => $avahi_dbus, + ensure => running, + enable => true, + require => Package[$avahi_mdns], + } + ini_setting { "avahi-${::hostname}": + ensure => present, + path => '/etc/avahi/avahi-daemon.conf', + section => 'server', + setting => 'host-name', + key_val_separator => '=', + value => $::hostname, + notify => Service[$avahi_daemon], + require => Package[$avahi_mdns], + } + } } -- cgit v1.2.3