summaryrefslogtreecommitdiff
path: root/manifests/init.pp
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 /manifests/init.pp
added apache module, rearranged some gentoo stuff
Diffstat (limited to 'manifests/init.pp')
-rw-r--r--manifests/init.pp67
1 files changed, 67 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,
+ }
+}
+