1 |
class blog { |
2 |
|
3 |
class base { |
4 |
user { "blog": |
5 |
groups => apache, |
6 |
comment => "Mageia Blog", |
7 |
ensure => present, |
8 |
managehome => true, |
9 |
home => "/var/lib/blog", |
10 |
} |
11 |
} |
12 |
|
13 |
class champagne inherits base { |
14 |
package { ['wget','php-mysql']: |
15 |
ensure => installed |
16 |
} |
17 |
|
18 |
file { "check_new-blog-post": |
19 |
path => "/usr/local/bin/check_new-blog-post.sh", |
20 |
ensure => present, |
21 |
owner => root, |
22 |
group => root, |
23 |
mode => 755, |
24 |
content => template("blog/check_new-blog-post.sh") |
25 |
} |
26 |
|
27 |
#cron { blog: |
28 |
# user => blog, |
29 |
# minute => '*/15', |
30 |
# command => "/usr/local/bin/check_new-blog-post.sh", |
31 |
# require => [File["check_new-blog-post"], User['blog']], |
32 |
#} |
33 |
|
34 |
include apache::mod_php |
35 |
|
36 |
$blog_location = "/var/www/html/blog.$domain" |
37 |
$blog_domain = "blog.$domain" |
38 |
|
39 |
apache::vhost_base { "$blog_domain": |
40 |
location => $blog_location, |
41 |
content => template('blog/blogs_vhosts.conf'), |
42 |
} |
43 |
|
44 |
apache::vhost_base { "ssl_$blog_domain": |
45 |
use_ssl => true, |
46 |
vhost => $blog_domain, |
47 |
location => $blog_location, |
48 |
content => template('blog/blogs_vhosts.conf'), |
49 |
} |
50 |
|
51 |
file { "$blog_location": |
52 |
ensure => directory, |
53 |
owner => apache, |
54 |
group => apache, |
55 |
mode => 644, |
56 |
} |
57 |
} |
58 |
} |