summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2008-01-30 12:32:41 +0000
committermh <mh@immerda.ch>2008-01-30 12:32:41 +0000
commitcd11b1f234101cee817542a197b74665b2e96209 (patch)
tree5baf267b4f7d8ceae992257c0309f20c0bf24ea4
added apache module, rearranged some gentoo stuff
-rw-r--r--manifests/init.pp67
-rw-r--r--templates/default/default_index.erb21
2 files changed, 88 insertions, 0 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
new file mode 100644
index 0000000..1d12cbd
--- /dev/null
+++ b/manifests/init.pp
@@ -0,0 +1,67 @@
+# modules/apache/manifests/init.pp
+# 2008 - admin(at)immerda.ch
+# License: GPLv3
+
+
+class apache {
+ package { 'apache':
+ name => $operatingsystem ? {
+ centos => 'httpd',
+ default => 'apache'
+ },
+ category => $operatingsystem ? {
+ gentoo => 'www-servers',
+ default => '',
+ },
+ ensure => present,
+ }
+
+ case $operatingsystem {
+ centos: {
+ package { 'mod_ssl':
+ name => 'mod_ssl',
+ ensure => present,
+ }
+ }
+ }
+
+ service { apache:
+ name => $operatingsystem ? {
+ centos => 'httpd',
+ default => 'apache2'
+ },
+ enable => true,
+ ensure => running,
+ require => Package[apache],
+ }
+
+ file { 'default_index':
+ path => $operatingsystem ? {
+ centos => '/var/www/html/index.html',
+ default => '/var/www/localhost/index.html'
+ },
+ ensure => file,
+ owner => 'root',
+ group => 0,
+ mode => 644,
+ require => Package[apache],
+ content => template('default/default_index.erb'),
+ }
+
+ case $operatingsystem {
+ centos: { include apache_centos }
+ }
+}
+
+
+
+### distro specific stuff
+class apache_centos {
+ file {'/etc/httpd/vhosts.d':
+ ensure => directory,
+ owner => root,
+ group => 0,
+ mode => 700,
+ }
+}
+
diff --git a/templates/default/default_index.erb b/templates/default/default_index.erb
new file mode 100644
index 0000000..f8d5569
--- /dev/null
+++ b/templates/default/default_index.erb
@@ -0,0 +1,21 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
+<head>
+<title><%= hostname %></title>
+<meta http-equiv="content-type" content="text/html; charset=utf-8" />
+</head>
+<body>
+<h1> No Page @ this location</h1>
+ <p>
+
+ <a href="http://validator.w3.org/check?uri=referer"><img
+ src="http://www.w3.org/Icons/valid-xhtml10"
+ alt="Valid XHTML 1.0 Strict" height="31" width="88" style="border:0px;" /></a>
+ </p>
+<p>
+<small><em><%= hostname %></em></small>
+</p>
+</body>
+</html>
+