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

  ViewVC Help
Powered by ViewVC 1.1.30