/[adm]/puppet/modules/blog/manifests/init.pp
ViewVC logotype

Contents of /puppet/modules/blog/manifests/init.pp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1427 - (show annotations) (download)
Wed Mar 30 09:29:10 2011 UTC (13 years ago) by dams
File size: 2970 byte(s)
add backup for blog files
1 class blog {
2
3 class base {
4 user { "blog":
5 groups => apache,
6 comment => "Mageia Blog",
7 ensure => present,
8 managehome => true,
9 home => "/var/lib/blog",
10 }
11 }
12
13 class files-bots inherits base {
14 package { ['wget','php-mysql']:
15 ensure => installed
16 }
17
18 file { "check_new-blog-post":
19 path => "/usr/local/bin/check_new-blog-post.sh",
20 ensure => present,
21 owner => root,
22 group => root,
23 mode => 755,
24 content => template("blog/check_new-blog-post.sh")
25 }
26
27 cron { "Blog bot":
28 user => blog,
29 minute => '*/15',
30 command => "/usr/local/bin/check_new-blog-post.sh",
31 require => [File["check_new-blog-post"], User['blog']],
32 }
33
34 include apache::mod_php
35
36 $blog_location = "/var/www/html/blog.$domain"
37 $blog_domain = "blog.$domain"
38
39 apache::vhost_base { "$blog_domain":
40 location => $blog_location,
41 content => template('blog/blogs_vhosts.conf'),
42 }
43
44 apache::vhost_base { "ssl_$blog_domain":
45 use_ssl => true,
46 vhost => $blog_domain,
47 location => $blog_location,
48 content => template('blog/blogs_vhosts.conf'),
49 }
50
51 file { "$blog_location":
52 ensure => directory,
53 owner => apache,
54 group => apache,
55 mode => 644,
56 }
57 }
58 class db_backup inherits base {
59 file { "/var/lib/blog/backup":
60 ensure => directory,
61 owner => root,
62 group => root,
63 mode => 644,
64 }
65
66 file { "backup_blog-db":
67 path => "/usr/local/bin/backup_blog-db.sh",
68 ensure => present,
69 owner => root,
70 group => root,
71 mode => 755,
72 content => template("blog/backup_blog-db.sh")
73 }
74
75 cron { "Backup DB (blog)":
76 user => root,
77 hour => '23',
78 minute => '42',
79 command => "/usr/local/bin/backup_blog-db.sh",
80 require => [File["backup_blog-db"]],
81 }
82 }
83 class files_backup inherits base {
84 file { "/var/lib/blog/backup":
85 ensure => directory,
86 owner => root,
87 group => root,
88 mode => 644,
89 }
90
91 file { "backup_blog-files":
92 path => "/usr/local/bin/backup_blog-files.sh",
93 ensure => present,
94 owner => root,
95 group => root,
96 mode => 755,
97 content => template("blog/backup_blog-files.sh")
98 }
99
100 cron { "Backup files (blog)":
101 user => root,
102 hour => '23',
103 minute => '42',
104 command => "/usr/local/bin/backup_blog-files.sh",
105 require => [File["backup_blog-files"]],
106 }
107 }
108 }

  ViewVC Help
Powered by ViewVC 1.1.30