]> gitweb.fluxo.info Git - puppet-avahi.git/commitdiff
Initial commit
authorMichael Stahnke <stahnma@puppetlabs.com>
Sun, 7 Oct 2012 19:40:10 +0000 (12:40 -0700)
committerMichael Stahnke <stahnma@puppetlabs.com>
Fri, 19 Oct 2012 00:14:00 +0000 (17:14 -0700)
Modulefile [new file with mode: 0644]
README [new file with mode: 0644]
manifests/init.pp [new file with mode: 0644]
spec/spec_helper.rb [new file with mode: 0644]
tests/init.pp [new file with mode: 0644]

diff --git a/Modulefile b/Modulefile
new file mode 100644 (file)
index 0000000..6056563
--- /dev/null
@@ -0,0 +1,11 @@
+name    'stahnma-avahi'
+version '0.0.1'
+source 'UNKNOWN'
+author 'stahnma'
+license 'Apache License, Version 2.0'
+summary 'UNKNOWN'
+description 'UNKNOWN'
+project_page 'UNKNOWN'
+
+## Add dependencies, if any:
+dependency 'cprice404-inifile', '>= 1.2.0'
diff --git a/README b/README
new file mode 100644 (file)
index 0000000..64ce0b5
--- /dev/null
+++ b/README
@@ -0,0 +1,17 @@
+avahi
+
+This is the avahi module.
+
+License
+-------
+Apache Software License 2.0
+
+
+Contact
+-------
+stahnma@fedoraproject.org
+
+
+Support
+-------
+none
diff --git a/manifests/init.pp b/manifests/init.pp
new file mode 100644 (file)
index 0000000..a9c7162
--- /dev/null
@@ -0,0 +1,55 @@
+# == Class: avahi
+#
+#  This module sets up avahi on EL based systems.
+#
+#
+#  Requirements:
+#    cprice404-inifile >= 0.0.3
+#
+# === Parameters
+#
+# === Examples
+#
+#  class { avahi:  }
+#
+# === Authors
+#
+# Michael Stahnke <stahnma@fedoraproject.org>
+#
+# === Copyright
+#
+# Copyright 2012 Michael Stahnke
+
+
+class avahi {
+
+    $avahi_pkgs = [ 'avahi', 'avahi-tools', 'nss-mdns' ]
+
+   package { $avahi_pkgs:
+     ensure  => installed,
+   }
+
+   service { 'avahi-daemon':
+     ensure    => running,
+     enable    => true,
+     hasstatus => true,
+     require   => Service['messagebus'],
+   }
+
+   service { 'messagebus':
+     ensure  => running,
+     enable  => true,
+     require => Package[$avahi_pkgs],
+   }
+
+  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'],
+  }
+
+}
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
new file mode 100644 (file)
index 0000000..5fda588
--- /dev/null
@@ -0,0 +1,17 @@
+dir = File.expand_path(File.dirname(__FILE__))
+$LOAD_PATH.unshift File.join(dir, 'lib')
+
+require 'mocha'
+require 'puppet'
+require 'rspec'
+require 'spec/autorun'
+
+Spec::Runner.configure do |config|
+    config.mock_with :mocha
+end
+
+# We need this because the RAL uses 'should' as a method.  This
+# allows us the same behaviour but with a different method name.
+class Object
+    alias :must :should
+end
diff --git a/tests/init.pp b/tests/init.pp
new file mode 100644 (file)
index 0000000..f313125
--- /dev/null
@@ -0,0 +1,11 @@
+# The baseline for module testing used by Puppet Labs is that each manifest
+# should have a corresponding test manifest that declares that class or defined
+# type.
+#
+# Tests are then run by using puppet apply --noop (to check for compilation errors
+# and view a log of events) or by fully applying the test in a virtual environment
+# (to compare the resulting system state to the desired state).
+#
+# Learn more about module testing here: http://docs.puppetlabs.com/guides/tests_smoke.html
+#
+include avahi