/[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 2802 - (show annotations) (download)
Mon Aug 20 11:51:51 2012 UTC (9 years, 3 months ago) by dams
File size: 2456 byte(s)
remove 'unzip' as added on 'base_packages.pp'
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 { ['php-mysql',
17 'php-ldap',
18 'unzip']: }
19
20 local_script { 'check_new-blog-post.sh':
21 content => template('blog/check_new-blog-post.sh'),
22 }
23
24 cron { 'Blog bot':
25 user => 'blog',
26 minute => '*/15',
27 command => '/usr/local/bin/check_new-blog-post.sh',
28 require => Local_script['check_new-blog-post.sh'],
29 }
30
31 include apache::mod::php
32
33 apache::vhost::base { "$blog_domain":
34 location => $blog_location,
35 content => template('blog/blogs_vhosts.conf'),
36 }
37
38 apache::vhost::base { "ssl_$blog_domain":
39 use_ssl => true,
40 vhost => $blog_domain,
41 location => $blog_location,
42 content => template('blog/blogs_vhosts.conf'),
43 }
44
45 file { $blog_location:
46 ensure => directory,
47 owner => apache,
48 group => apache,
49 }
50 }
51
52 class db_backup inherits base {
53 file { $blog_db_backupdir:
54 ensure => directory,
55 }
56
57 local_script { 'backup_blog-db.sh':
58 content => template('blog/backup_blog-db.sh'),
59 }
60
61 cron { "Backup DB (blog)":
62 user => root,
63 hour => '23',
64 minute => '42',
65 command => '/usr/local/bin/backup_blog-db.sh',
66 require => Local_script['backup_blog-db.sh'],
67 }
68 }
69
70 class files_backup inherits base {
71 file { $blog_files_backupdir:
72 ensure => directory,
73 }
74
75 local_script { 'backup_blog-files.sh':
76 content => template('blog/backup_blog-files.sh'),
77 }
78
79 cron { 'Backup files (blog)':
80 user => root,
81 hour => '23',
82 minute => '42',
83 command => '/usr/local/bin/backup_blog-files.sh',
84 require => Local_script['backup_blog-files.sh'],
85 }
86 }
87 }

  ViewVC Help
Powered by ViewVC 1.1.28