]> gitweb.fluxo.info Git - puppet-avahi.git/commitdiff
Do not attempt to do avahi stuff on non-linux
authorMichael Stahnke <stahnma@puppetlabs.com>
Sun, 28 Oct 2012 23:04:36 +0000 (16:04 -0700)
committerMichael Stahnke <stahnma@puppetlabs.com>
Sun, 28 Oct 2012 23:06:23 +0000 (16:06 -0700)
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>
manifests/init.pp

index c5bca5808095cb89daffa186181b1c9b167264f0..cbd21aa8115dd06b8b3516128b648c94dc6b237c 100644 (file)
 
 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],
+    }
+  }
 }