1 |
dams |
911 |
class planet { |
2 |
dams |
1093 |
|
3 |
dams |
993 |
user { "planet": |
4 |
dams |
1002 |
groups => apache, |
5 |
dams |
1261 |
comment => "Planet Mageia", |
6 |
dams |
1000 |
ensure => present, |
7 |
|
|
managehome => true, |
8 |
dams |
1093 |
home => "/var/lib/planet", |
9 |
dams |
993 |
} |
10 |
dams |
1000 |
|
11 |
boklm |
1615 |
$planet_location = "/var/www/vhosts/planet.$domain" |
12 |
dams |
1093 |
$planet_domain = "planet.$domain" |
13 |
|
|
|
14 |
dams |
909 |
include apache::mod_php |
15 |
dams |
1020 |
include apache::mod_deflate |
16 |
dams |
1093 |
apache::vhost_base { "$planet_domain": |
17 |
|
|
location => $planet_location, |
18 |
dams |
1094 |
content => template('planet/planet_vhosts.conf') |
19 |
dams |
909 |
} |
20 |
|
|
|
21 |
dams |
1108 |
file { "deploy_new-planet": |
22 |
|
|
path => "/usr/local/bin/deploy_new-planet.sh", |
23 |
|
|
ensure => present, |
24 |
|
|
owner => root, |
25 |
|
|
group => root, |
26 |
|
|
mode => 755, |
27 |
|
|
content => template("planet/deploy_new-planet.sh") |
28 |
|
|
} |
29 |
|
|
|
30 |
boklm |
1615 |
file { "$planet_location": |
31 |
dams |
909 |
ensure => directory, |
32 |
dams |
1002 |
owner => planet, |
33 |
dams |
1111 |
group => apache, |
34 |
dams |
909 |
mode => 644, |
35 |
|
|
} |
36 |
dams |
1018 |
|
37 |
dams |
1131 |
file { "index": |
38 |
dams |
1133 |
path => "$planet_location/index.php", |
39 |
dams |
1134 |
ensure => present, |
40 |
dams |
1131 |
owner => planet, |
41 |
|
|
group => apache, |
42 |
|
|
mode => 755, |
43 |
|
|
content => template("planet/index.php") |
44 |
|
|
} |
45 |
|
|
|
46 |
dams |
1020 |
package { ['php-iconv']: |
47 |
dams |
1018 |
ensure => installed |
48 |
dams |
1431 |
} |
49 |
|
|
|
50 |
|
|
class files_backup inherits base { |
51 |
|
|
file { "/var/lib/planet/backup": |
52 |
|
|
ensure => directory, |
53 |
|
|
owner => root, |
54 |
|
|
group => root, |
55 |
|
|
mode => 644, |
56 |
|
|
} |
57 |
|
|
|
58 |
|
|
file { "backup_planet-files": |
59 |
|
|
path => "/usr/local/bin/backup_planet-files.sh", |
60 |
|
|
ensure => present, |
61 |
|
|
owner => root, |
62 |
|
|
group => root, |
63 |
|
|
mode => 755, |
64 |
|
|
content => template("blog/backup_planet-files.sh") |
65 |
|
|
} |
66 |
|
|
|
67 |
|
|
cron { "Backup files (planet)": |
68 |
|
|
user => root, |
69 |
|
|
hour => '23', |
70 |
|
|
minute => '42', |
71 |
|
|
command => "/usr/local/bin/backup_planet-files.sh", |
72 |
|
|
require => [File["backup_planet-files"]], |
73 |
|
|
} |
74 |
dams |
1018 |
} |
75 |
dams |
909 |
} |