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 |
} |
9 |
|
10 |
include apache::mod_php |
11 |
include mysql |
12 |
apache::vhost_other_app { "blog-test.$domain": |
13 |
vhost_file => "blog/blogs_vhosts.conf", |
14 |
} |
15 |
|
16 |
package { ['wget','php-mysql']: |
17 |
ensure => installed |
18 |
} |
19 |
|
20 |
file { "/var/lib/blog": |
21 |
ensure => directory, |
22 |
owner => blog, |
23 |
group => blog, |
24 |
mode => 644, |
25 |
} |
26 |
|
27 |
file { "check_new-blog-post": |
28 |
path => "/usr/local/bin/check_new-blog-post.sh", |
29 |
ensure => present, |
30 |
owner => blog, |
31 |
group => blog, |
32 |
mode => 755, |
33 |
content => template("blog/check_new-blog-post.sh") |
34 |
} |
35 |
|
36 |
file { "/var/www/html/blog.$domain": |
37 |
ensure => directory, |
38 |
owner => blog, |
39 |
group => blog, |
40 |
mode => 644, |
41 |
} |
42 |
|
43 |
cron { blog: |
44 |
user => blog, |
45 |
minute => '*/15', |
46 |
command => "/usr/local/bin/check_new-blog-post.sh", |
47 |
require => File["check_new-blog-post"] |
48 |
} |
49 |
} |