Index: src/puppetcode/environments/test/modules/gnuboat_hostapd/files/default
===================================================================
--- src/puppetcode/environments/test/modules/gnuboat_hostapd/files/default	(revision 2925c4a8a48723d6c3c3266571ca9c7a2c90335e)
+++ src/puppetcode/environments/test/modules/gnuboat_hostapd/files/default	(revision 2925c4a8a48723d6c3c3266571ca9c7a2c90335e)
@@ -0,0 +1,20 @@
+# Defaults for hostapd initscript
+#
+# See /usr/share/doc/hostapd/README.Debian for information about alternative
+# methods of managing hostapd.
+#
+# Uncomment and set DAEMON_CONF to the absolute path of a hostapd configuration
+# file and hostapd will be started during system boot. An example configuration
+# file can be found at /usr/share/doc/hostapd/examples/hostapd.conf.gz
+#
+DAEMON_CONF="/etc/hostapd/hostapd.conf"
+
+# Additional daemon options to be appended to hostapd command:-
+# 	-d   show more debug messages (-dd for even more)
+# 	-K   include key data in debug messages
+# 	-t   include timestamps in some debug messages
+#
+# Note that -B (daemon mode) and -P (pidfile) options are automatically
+# configured by the init.d script and must not be added to DAEMON_OPTS.
+#
+#DAEMON_OPTS=""
Index: src/puppetcode/environments/test/modules/gnuboat_hostapd/manifests/config.pp
===================================================================
--- src/puppetcode/environments/test/modules/gnuboat_hostapd/manifests/config.pp	(revision e62038bcb59dc4a72128708ef8fdb0ebcb91250d)
+++ src/puppetcode/environments/test/modules/gnuboat_hostapd/manifests/config.pp	(revision 2925c4a8a48723d6c3c3266571ca9c7a2c90335e)
@@ -1,5 +1,6 @@
-class config
+class gnuboat_hostapd::config
 (
-	String $interface = 'wlan0',
+	String $interface,
+	String $netmask = '255.255.255.0',
 	String $hw_mode = 'g',
 	Integer $channel = 0,
@@ -9,19 +10,19 @@
 	Boolean $ieee80211ac = false,
 	Boolean $wmm_enabled = false,
-	String $ssid = 'GNU Boat',
+	String $ssid = 'GNUBoat',
 	Enum['1', '2', '3'] $auth_algs = '1',
-	Integer $wpa = '2',
+	Integer $wpa = 2,
 	String $wpa_key_mgmt = 'WPA-PSK',
 	String $rsn_pairwise = 'CCMP',
-	String $wpa_passphrase = 'GNUBoat',
+	String $wpa_passphrase = 'gnu.boat',
 )
-inherits hostapd
+inherits gnuboat_hostapd
 {
-	file{'/etc/hostapd/hostapd.conf',
+	file{'/etc/hostapd/hostapd.conf':
 		ensure => present,
 		owner => 'root',
 		group => 'root',
 		mode => '0600',
-		content => epp('puppet:///hostapd/hostapd.conf.epp',
+		content => epp('gnuboat_hostapd/hostapd.conf.epp',
 			{
 				'interface' => $interface,
@@ -42,3 +43,26 @@
 		),
 	}
+
+	file{'/etc/network/interfaces.d/hostapd':
+		ensure => present,
+		owner => 'root',
+		group => 'root',
+		mode => '0600',
+		content => epp('gnuboat_hostapd/hostapd.interface.epp',
+			{
+				'interface' => $interface,
+				'hostip' => $hostip,
+				'netmask' => $netmask
+			}
+		),
+	}
+
+	file{'/etc/default/hostapd':
+		ensure => present,
+                owner => 'root',
+                group => 'root',
+                mode => '0600',
+                content => file('gnuboat_hostapd/default'),
+	}
+
 }
Index: src/puppetcode/environments/test/modules/gnuboat_hostapd/manifests/dnsmasq_config.pp
===================================================================
--- src/puppetcode/environments/test/modules/gnuboat_hostapd/manifests/dnsmasq_config.pp	(revision 2925c4a8a48723d6c3c3266571ca9c7a2c90335e)
+++ src/puppetcode/environments/test/modules/gnuboat_hostapd/manifests/dnsmasq_config.pp	(revision 2925c4a8a48723d6c3c3266571ca9c7a2c90335e)
@@ -0,0 +1,36 @@
+class gnuboat_hostapd::dnsmasq_config
+(
+	String $hostname = 'gnu',
+	String $domain = 'boat',
+	String $dhcp_range = '192.168.254.2,192.168.254.254,12h',
+)
+inherits gnuboat_hostapd
+{
+	file{'/etc/hosts':
+		ensure => present,
+		owner => 'root',
+		group => 'root',
+		mode => '0600',
+		content => epp('gnuboat_hostapd/hosts.epp',
+			{
+				'hostip' => $hostip,
+				'hostname' => $hostname,
+				'domain' => $domain,
+			}
+		),
+	}
+
+
+	file{'/etc/dnsmasq.conf':
+		ensure => present,
+		owner => 'root',
+		group => 'root',
+		mode => '0600',
+		content => epp('gnuboat_hostapd/dnsmasq.conf.epp',
+			{
+				'hostip' => $hostip,
+				'dhcp_range' => $dhcp_range,
+			}
+		),
+	}
+}
Index: src/puppetcode/environments/test/modules/gnuboat_hostapd/manifests/dnsmasq_install.pp
===================================================================
--- src/puppetcode/environments/test/modules/gnuboat_hostapd/manifests/dnsmasq_install.pp	(revision 2925c4a8a48723d6c3c3266571ca9c7a2c90335e)
+++ src/puppetcode/environments/test/modules/gnuboat_hostapd/manifests/dnsmasq_install.pp	(revision 2925c4a8a48723d6c3c3266571ca9c7a2c90335e)
@@ -0,0 +1,7 @@
+class gnuboat_hostapd::dnsmasq_install() inherits gnuboat_hostapd
+{
+	package{'dnsmasq':
+		ensure => $version,
+		notify => Service['dnsmasq'],
+	}
+}
Index: src/puppetcode/environments/test/modules/gnuboat_hostapd/manifests/dnsmasq_service.pp
===================================================================
--- src/puppetcode/environments/test/modules/gnuboat_hostapd/manifests/dnsmasq_service.pp	(revision 2925c4a8a48723d6c3c3266571ca9c7a2c90335e)
+++ src/puppetcode/environments/test/modules/gnuboat_hostapd/manifests/dnsmasq_service.pp	(revision 2925c4a8a48723d6c3c3266571ca9c7a2c90335e)
@@ -0,0 +1,13 @@
+class gnuboat_hostapd::dnsmasq_service
+(
+	Enum['running', 'stopped'] $status = 'running',
+	Boolean $enabled = true,
+)
+inherits gnuboat_hostapd
+{
+	service{'dnsmasq':
+		ensure => $status,
+		enable => $enabled,
+		subscribe => Package['dnsmasq'],
+	}
+}
Index: src/puppetcode/environments/test/modules/gnuboat_hostapd/manifests/init.pp
===================================================================
--- src/puppetcode/environments/test/modules/gnuboat_hostapd/manifests/init.pp	(revision e62038bcb59dc4a72128708ef8fdb0ebcb91250d)
+++ src/puppetcode/environments/test/modules/gnuboat_hostapd/manifests/init.pp	(revision 2925c4a8a48723d6c3c3266571ca9c7a2c90335e)
@@ -1,7 +1,28 @@
-class hostapd
+class gnuboat_hostapd
 (
 	String $version = 'latest',
+	String $hostip = '192.168.254.1',
+	String $hostname = 'gnu',
+	String $domain = 'boat',
+	Boolean $dnsmasq_enable = true,
 )
 {
+	contain gnuboat_hostapd::install
+	contain gnuboat_hostapd::service
+	contain gnuboat_hostapd::config
 
+	Class['gnuboat_hostapd::install'] ->
+	Class['gnuboat_hostapd::config'] ->
+	Class['gnuboat_hostapd::service']
+
+
+	if $dnsmasq_enable {
+		contain gnuboat_hostapd::dnsmasq_install
+		contain gnuboat_hostapd::dnsmasq_service
+		contain gnuboat_hostapd::dnsmasq_config
+
+		Class['gnuboat_hostapd::dnsmasq_install'] ->
+		Class['gnuboat_hostapd::dnsmasq_config'] ->
+		Class['gnuboat_hostapd::dnsmasq_service']
+	}
 }
Index: src/puppetcode/environments/test/modules/gnuboat_hostapd/manifests/install.pp
===================================================================
--- src/puppetcode/environments/test/modules/gnuboat_hostapd/manifests/install.pp	(revision e62038bcb59dc4a72128708ef8fdb0ebcb91250d)
+++ src/puppetcode/environments/test/modules/gnuboat_hostapd/manifests/install.pp	(revision 2925c4a8a48723d6c3c3266571ca9c7a2c90335e)
@@ -1,3 +1,3 @@
-class hostapd::install() inherits hostapd
+class gnuboat_hostapd::install() inherits gnuboat_hostapd
 {
 	package{'hostapd':
Index: src/puppetcode/environments/test/modules/gnuboat_hostapd/manifests/service.pp
===================================================================
--- src/puppetcode/environments/test/modules/gnuboat_hostapd/manifests/service.pp	(revision e62038bcb59dc4a72128708ef8fdb0ebcb91250d)
+++ src/puppetcode/environments/test/modules/gnuboat_hostapd/manifests/service.pp	(revision 2925c4a8a48723d6c3c3266571ca9c7a2c90335e)
@@ -1,8 +1,8 @@
-class hostapd::service
+class gnuboat_hostapd::service
 (
 	Enum['running', 'stopped'] $status = 'running',
 	Boolean $enabled = true,
 )
-inherits hostapd
+inherits gnuboat_hostapd
 {
 	service{'hostapd':
Index: src/puppetcode/environments/test/modules/gnuboat_hostapd/templates/default.epp
===================================================================
--- src/puppetcode/environments/test/modules/gnuboat_hostapd/templates/default.epp	(revision 2925c4a8a48723d6c3c3266571ca9c7a2c90335e)
+++ src/puppetcode/environments/test/modules/gnuboat_hostapd/templates/default.epp	(revision 2925c4a8a48723d6c3c3266571ca9c7a2c90335e)
@@ -0,0 +1,20 @@
+# Defaults for hostapd initscript
+#
+# See /usr/share/doc/hostapd/README.Debian for information about alternative
+# methods of managing hostapd.
+#
+# Uncomment and set DAEMON_CONF to the absolute path of a hostapd configuration
+# file and hostapd will be started during system boot. An example configuration
+# file can be found at /usr/share/doc/hostapd/examples/hostapd.conf.gz
+#
+DAEMON_CONF="/etc/hostapd/hostapd.conf"
+
+# Additional daemon options to be appended to hostapd command:-
+# 	-d   show more debug messages (-dd for even more)
+# 	-K   include key data in debug messages
+# 	-t   include timestamps in some debug messages
+#
+# Note that -B (daemon mode) and -P (pidfile) options are automatically
+# configured by the init.d script and must not be added to DAEMON_OPTS.
+#
+#DAEMON_OPTS=""
Index: src/puppetcode/environments/test/modules/gnuboat_hostapd/templates/dnsmasq.conf.epp
===================================================================
--- src/puppetcode/environments/test/modules/gnuboat_hostapd/templates/dnsmasq.conf.epp	(revision 2925c4a8a48723d6c3c3266571ca9c7a2c90335e)
+++ src/puppetcode/environments/test/modules/gnuboat_hostapd/templates/dnsmasq.conf.epp	(revision 2925c4a8a48723d6c3c3266571ca9c7a2c90335e)
@@ -0,0 +1,11 @@
+listen-address=127.0.0.1,<%= $hostip %>
+# redirect all dns names to localhost
+# (currently deactivated, because dnsmasq changes /etc/resolv.conf to 127.0.0.1 on localhost,
+#  if all requests are relocated, this pc can not reach any host!)
+# address=/#/<%= $hostip %>
+dhcp-range=<%= $dhcp_range %>
+#gateway
+dhcp-option=3,<%= $hostip %>
+dhcp-option=6,<%= $hostip %>
+domain=boat
+expand-hosts
Index: src/puppetcode/environments/test/modules/gnuboat_hostapd/templates/hostapd.conf.epp
===================================================================
--- src/puppetcode/environments/test/modules/gnuboat_hostapd/templates/hostapd.conf.epp	(revision e62038bcb59dc4a72128708ef8fdb0ebcb91250d)
+++ src/puppetcode/environments/test/modules/gnuboat_hostapd/templates/hostapd.conf.epp	(revision 2925c4a8a48723d6c3c3266571ca9c7a2c90335e)
@@ -6,9 +6,9 @@
 ieee80211n=<%= $ieee80211n %>
 ieee80211ac=<%= $ieee80211ac %>
-<% if wmm_enabled %>
-	wmm_enabled=1
-<% else %>
-	wmm_enabled=0
-<% end %>
+<% if wmm_enabled { -%>
+wmm_enabled=1
+<% } else { -%>
+wmm_enabled=0
+<% } -%>
 ssid=<%= $ssid %>
 auth_algs=<%= $auth_algs %>
Index: src/puppetcode/environments/test/modules/gnuboat_hostapd/templates/hostapd.interface.epp
===================================================================
--- src/puppetcode/environments/test/modules/gnuboat_hostapd/templates/hostapd.interface.epp	(revision 2925c4a8a48723d6c3c3266571ca9c7a2c90335e)
+++ src/puppetcode/environments/test/modules/gnuboat_hostapd/templates/hostapd.interface.epp	(revision 2925c4a8a48723d6c3c3266571ca9c7a2c90335e)
@@ -0,0 +1,4 @@
+auto <%= $interface %>
+iface <%= $interface %> inet static
+  address <%= $hostip %>
+  netmask <%= $netmask %>
Index: src/puppetcode/environments/test/modules/gnuboat_hostapd/templates/hosts.epp
===================================================================
--- src/puppetcode/environments/test/modules/gnuboat_hostapd/templates/hosts.epp	(revision 2925c4a8a48723d6c3c3266571ca9c7a2c90335e)
+++ src/puppetcode/environments/test/modules/gnuboat_hostapd/templates/hosts.epp	(revision 2925c4a8a48723d6c3c3266571ca9c7a2c90335e)
@@ -0,0 +1,7 @@
+127.0.0.1	localhost
+127.0.0.1	<%= $hostname %>
+::1		localhost ip6-localhost ip6-loopback
+ff02::1		ip6-allnodes
+ff02::2		ip6-allrouters
+
+<%= $hostip %>	<%= $hostname %>.<%= $domain %> <%= $hostname %>
