/[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 2685 - (show annotations) (download)
Sun Mar 25 12:20:32 2012 UTC (12 years ago) by misc
File size: 2475 byte(s)
use the new name for mod_php module
1 class blog {
2 class base {
3 $blog_domain = "blog.$::domain"
4 $blog_location = "/var/www/vhosts/$blog_domain"
5 $blog_db_backupdir = "/var/lib/backups/blog_db"
6 $blog_files_backupdir = "/var/lib/backups/blog_files"
7
8 user { 'blog':
9 groups => apache,
10 comment => 'User to run script checking for new blog post',
11 home => '/var/lib/blog',
12 }
13 }
14
15 class files-bots inherits base {
16 package { ['wget',
17 'php-mysql',
18 'php-ldap',
19 'unzip']: }
20
21 local_script { 'check_new-blog-post.sh':
22 content => template('blog/check_new-blog-post.sh'),
23 }
24
25 cron { 'Blog bot':
26 user => 'blog',
27 minute => '*/15',
28 command => '/usr/local/bin/check_new-blog-post.sh',
29 require => Local_script['check_new-blog-post.sh'],
30 }
31
32 include apache::mod::php
33
34 apache::vhost_base { "$blog_domain":
35 location => $blog_location,
36 content => template('blog/blogs_vhosts.conf'),
37 }
38
39 apache::vhost_base { "ssl_$blog_domain":
40 use_ssl => true,
41 vhost => $blog_domain,
42 location => $blog_location,
43 content => template('blog/blogs_vhosts.conf'),
44 }
45
46 file { $blog_location:
47 ensure => directory,
48 owner => apache,
49 group => apache,
50 }
51 }
52
53 class db_backup inherits base {
54 file { $blog_db_backupdir:
55 ensure => directory,
56 }
57
58 local_script { 'backup_blog-db.sh':
59 content => template('blog/backup_blog-db.sh'),
60 }
61
62 cron { "Backup DB (blog)":
63 user => root,
64 hour => '23',
65 minute => '42',
66 command => '/usr/local/bin/backup_blog-db.sh',
67 require => Local_script['backup_blog-db'],
68 }
69 }
70
71 class files_backup inherits base {
72 file { $blog_files_backupdir:
73 ensure => directory,
74 }
75
76 local_script { 'backup_blog-files.sh':
77 content => template('blog/backup_blog-files.sh'),
78 }
79
80 cron { 'Backup files (blog)':
81 user => root,
82 hour => '23',
83 minute => '42',
84 command => '/usr/local/bin/backup_blog-files.sh',
85 require => Local_script['backup_blog-files'],
86 }
87 }
88 }

  ViewVC Help
Powered by ViewVC 1.1.30