diff options
author | Jerome Charaoui <jcharaoui@cmaisonneuve.qc.ca> | 2009-12-08 12:20:08 -0500 |
---|---|---|
committer | Jerome Charaoui <jcharaoui@cmaisonneuve.qc.ca> | 2009-12-08 12:20:08 -0500 |
commit | f3be4617f18ae0c31d26efc47ad5e5f11887052e (patch) | |
tree | 10841498c1704c6d17db19fc826bb7706a71dd09 /manifests | |
parent | 00c03fcdaad9322c7610437953ee0fb4c009d4b5 (diff) |
improve Debian support
Diffstat (limited to 'manifests')
-rw-r--r-- | manifests/debian.pp | 14 | ||||
-rw-r--r-- | manifests/debian/module.pp | 25 | ||||
-rw-r--r-- | manifests/ssl.pp | 1 | ||||
-rw-r--r-- | manifests/ssl/debian.pp | 9 | ||||
-rw-r--r-- | manifests/vhost/file.pp | 4 |
5 files changed, 49 insertions, 4 deletions
diff --git a/manifests/debian.pp b/manifests/debian.pp index 8733a91..b16dc9d 100644 --- a/manifests/debian.pp +++ b/manifests/debian.pp @@ -2,8 +2,18 @@ class apache::debian inherits apache::package { $config_dir = '/etc/apache2' - file {"$vhosts_dir": - ensure => "${config_dir}/sites-enabled", + Package[apache] { + name => 'apache2', + } + File[vhosts_dir] { + path => "${config_dir}/sites-enabled", + } + File[modules_dir] { + path => "${config_dir}/mods-enabled", + } + File[htpasswd_dir] { + path => "/var/www/htpasswds", + group => 'www-data', } File[default_apache_index] { path => '/var/www/index.html', diff --git a/manifests/debian/module.pp b/manifests/debian/module.pp new file mode 100644 index 0000000..31eb508 --- /dev/null +++ b/manifests/debian/module.pp @@ -0,0 +1,25 @@ +define apache::debian::module( + $ensure = present +){ + $modules_dir = "$apache::debian::config_dir/mods" + + case $ensure { + 'present' : { + exec { "/usr/sbin/a2enmod $name": + unless => "/bin/sh -c '[ -L ${modules_dir}-enabled/${name}.load ] \\ + && [ ${modules_dir}-enabled/${name}.load -ef ${modules_dir}-available/${name}.load ]'", + notify => Service['apache'], + require => Package['apache'], + } + } + 'absent': { + exec { "/usr/sbin/a2dismod $name": + onlyif => "/bin/sh -c '[ -L ${modules_dir}-enabled/${name}.load ] \\ + && [ ${modules_dir}-enabled/${name}.load -ef ${modules_dir}-available/${name}.load ]'", + notify => Service['apache'], + require => Package['apache'], + } + } + } +} + diff --git a/manifests/ssl.pp b/manifests/ssl.pp index 75305be..c779da4 100644 --- a/manifests/ssl.pp +++ b/manifests/ssl.pp @@ -4,6 +4,7 @@ class apache::ssl inherits apache { case $operatingsystem { centos: { include apache::ssl::centos } openbsd: { include apache::ssl::openbsd } + debian: { include apache::ssl::debian } defaults: { include apache::ssl::base } } if $use_shorewall { diff --git a/manifests/ssl/debian.pp b/manifests/ssl/debian.pp new file mode 100644 index 0000000..10b1631 --- /dev/null +++ b/manifests/ssl/debian.pp @@ -0,0 +1,9 @@ +class apache::ssl::debian inherits apache::ssl::base { + line { 'apache_debian_ssl_port': + file => "${apache::debian::config_dir}/ports.conf", + line => "Listen 443", + ensure => present, + require => Package['apache'], + notify => Service['apache'], + } +} diff --git a/manifests/vhost/file.pp b/manifests/vhost/file.pp index caa649d..29325bb 100644 --- a/manifests/vhost/file.pp +++ b/manifests/vhost/file.pp @@ -20,8 +20,8 @@ define apache::vhost::file( $vhosts_dir = $operatingsystem ? { centos => "$apache::centos::config_dir/vhosts.d", gentoo => "$apache::gentoo::config_dir/vhosts.d", - debian => "$apache::debian::config_dir/vhosts.d", - ubuntu => "$apache::ubuntu::config_dir/vhosts.d", + debian => "$apache::debian::config_dir/sites-enabled", + ubuntu => "$apache::ubuntu::config_dir/sites-enabled", openbsd => "$apache::openbsd::config_dir/vhosts.d", default => '/etc/apache2/vhosts.d', } |