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