/[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 2199 - (show annotations) (download)
Sun Jan 8 20:24:58 2012 UTC (9 years, 6 months ago) by misc
File size: 3035 byte(s)
add defaults values for user created by puppet, to remove duplication
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','php-mysql','php-ldap','unzip']:
18 ensure => installed
19 }
20
21 file { "check_new-blog-post":
22 path => "/usr/local/bin/check_new-blog-post.sh",
23 ensure => present,
24 owner => root,
25 group => root,
26 mode => 755,
27 content => template("blog/check_new-blog-post.sh")
28 }
29
30 cron { "Blog bot":
31 user => blog,
32 minute => '*/15',
33 command => "/usr/local/bin/check_new-blog-post.sh",
34 require => [File["check_new-blog-post"], User['blog']],
35 }
36
37 include apache::mod_php
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 { $blog_db_backupdir:
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 { $blog_files_backupdir:
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.28