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