diff options
author | Michael Stahnke <stahnma@puppetlabs.com> | 2012-10-28 16:04:36 -0700 |
---|---|---|
committer | Michael Stahnke <stahnma@puppetlabs.com> | 2012-10-28 16:06:23 -0700 |
commit | 849c20ec690897400551da053bc100b4d9cdb347 (patch) | |
tree | 4c1bdfd3e5560932bcc865e4a87fe2b8add752e9 | |
parent | 7d2a9c9b3eb44da735a70cd31868c1eca0365abe (diff) | |
download | puppet-avahi-849c20ec690897400551da053bc100b4d9cdb347.tar.gz puppet-avahi-849c20ec690897400551da053bc100b4d9cdb347.tar.bz2 |
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 <stahnma@puppetlabs.com>
-rw-r--r-- | manifests/init.pp | 68 |
1 files 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], + } + } } |