1 |
class planet { |
2 |
|
3 |
user { 'planet': |
4 |
groups => 'apache', |
5 |
comment => 'Planet Mageia', |
6 |
home => '/var/lib/planet', |
7 |
} |
8 |
|
9 |
$vhost = "planet.$::domain" |
10 |
$location = "/var/www/vhosts/$vhost" |
11 |
|
12 |
include apache::mod::php |
13 |
include apache::mod::deflate |
14 |
|
15 |
apache::vhost::base { $vhost: |
16 |
location => $location, |
17 |
content => template('planet/planet_vhosts.conf') |
18 |
} |
19 |
|
20 |
local_script { 'deploy_new-planet.sh': |
21 |
content => template('planet/deploy_new-planet.sh') |
22 |
} |
23 |
|
24 |
file { $location: |
25 |
ensure => directory, |
26 |
} |
27 |
|
28 |
file { "$location/index.php": |
29 |
content => template('planet/index.php') |
30 |
} |
31 |
|
32 |
package { ['php-iconv']: } |
33 |
|
34 |
class files_backup inherits base { |
35 |
file { "/var/lib/planet/backup": |
36 |
ensure => directory, |
37 |
} |
38 |
|
39 |
local_script { "backup_planet-files.sh": |
40 |
content => template("blog/backup_planet-files.sh") |
41 |
} |
42 |
|
43 |
cron { "Backup files (planet)": |
44 |
user => root, |
45 |
hour => '23', |
46 |
minute => '42', |
47 |
command => "/usr/local/bin/backup_planet-files.sh", |
48 |
require => [File["backup_planet-files"]], |
49 |
} |
50 |
} |
51 |
} |