From 0bcb3aae2bed161823d7488c91b559a01304d7a5 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sun, 8 Nov 2009 13:03:23 -0200 Subject: Ensuring folders exist with right modes and ownership --- manifests/init.pp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'manifests') diff --git a/manifests/init.pp b/manifests/init.pp index 73852f1..3c6bcb5 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -42,6 +42,7 @@ class apache { } service { "apache": + name => "apache2", ensure => running, require => Package["apache"], hasstatus => true, @@ -73,7 +74,6 @@ class apache { '': { $apache_www_folder = '/var/www' } } - # TODO: ensure folders exist with right modes and ownership define site($ensure = present, $docroot = false, $redirect = false, $protocol = 'http', $server_alias = false, $use = false) { file { "${apache2_sites}-available/$title": @@ -107,6 +107,12 @@ class apache { && [ ${apache2_sites}-enabled/$name -ef ${apache2_sites}-available/$name ]'", notify => Exec["reload-apache2"], } + file { "${docroot}": + ensure => directory, + owner => root, + group => root, + mode => 0755, + } } 'absent': { exec { "/usr/sbin/a2dissite $name": -- cgit v1.2.3