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