aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahnke <stahnma@puppetlabs.com>2012-10-07 12:40:10 -0700
committerMichael Stahnke <stahnma@puppetlabs.com>2012-10-18 17:14:00 -0700
commitf3f8eabdf1bc8d73dd8a5ede8f197fcd834d78ea (patch)
tree2dec497f40ca1083ec4d8893cd451c6b284371be
downloadpuppet-avahi-f3f8eabdf1bc8d73dd8a5ede8f197fcd834d78ea.tar.gz
puppet-avahi-f3f8eabdf1bc8d73dd8a5ede8f197fcd834d78ea.tar.bz2
Initial commit
-rw-r--r--Modulefile11
-rw-r--r--README17
-rw-r--r--manifests/init.pp55
-rw-r--r--spec/spec_helper.rb17
-rw-r--r--tests/init.pp11
5 files changed, 111 insertions, 0 deletions
diff --git a/Modulefile b/Modulefile
new file mode 100644
index 0000000..6056563
--- /dev/null
+++ b/Modulefile
@@ -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
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
index 0000000..a9c7162
--- /dev/null
+++ b/manifests/init.pp
@@ -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
index 0000000..5fda588
--- /dev/null
+++ b/spec/spec_helper.rb
@@ -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
index 0000000..f313125
--- /dev/null
+++ b/tests/init.pp
@@ -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