1 |
class blog { |
2 |
|
3 |
user { "blog": |
4 |
groups => apache, |
5 |
comment => "User running cron jobs for blog", |
6 |
ensure => present, |
7 |
managehome => true, |
8 |
home => "/var/lib/blog", |
9 |
} |
10 |
|
11 |
include apache::mod_php |
12 |
include mysql |
13 |
apache::vhost_other_app { "blog-test.$domain": |
14 |
vhost_file => "blog/blogs_vhosts.conf", |
15 |
} |
16 |
|
17 |
package { ['wget','php-mysql']: |
18 |
ensure => installed |
19 |
} |
20 |
|
21 |
file { "check_new-blog-post": |
22 |
path => "/usr/local/bin/check_new-blog-post.sh", |
23 |
ensure => present, |
24 |
owner => blog, |
25 |
group => blog, |
26 |
mode => 755, |
27 |
content => template("blog/check_new-blog-post.sh") |
28 |
} |
29 |
|
30 |
file { "/var/www/html/blog.$domain": |
31 |
ensure => directory, |
32 |
owner => blog, |
33 |
group => blog, |
34 |
mode => 644, |
35 |
} |
36 |
|
37 |
cron { blog: |
38 |
user => blog, |
39 |
minute => '*/15', |
40 |
command => "/usr/local/bin/check_new-blog-post.sh", |
41 |
require => File["check_new-blog-post"] |
42 |
} |
43 |
} |