aboutsummaryrefslogtreecommitdiffstats
path: root/modules/blog/manifests/init.pp
blob: d36406383aeda1e38ee8fea4af124786248098f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
class blog {

    class base {
        user { "blog":
        groups => apache,
        comment => "Mageia Blog",
        ensure => present,
        managehome => true,
        home => "/var/lib/blog",
        }
    }
    
    class champagne inherits base {
        package { ['wget','php-mysql']:
            ensure => installed
        }

        file { "check_new-blog-post":
            path => "/usr/local/bin/check_new-blog-post.sh",
            ensure => present,
            owner => root,
            group => root,
            mode => 755,
            content => template("blog/check_new-blog-post.sh")
        }
   
        cron { blog:
            user => blog,
            minute => '*/15',
            command => "/usr/local/bin/check_new-blog-post.sh",
            require => [File["check_new-blog-post"], User['blog']],
        }

        include apache::mod_php

        $blog_location = "/var/www/html/blog.$domain"
        $blog_domain = "blog.$domain"

        apache::vhost_base { "$blog_domain":
            location => $blog_location,
            content => template('blog/blogs_vhosts.conf'),
        }

        apache::vhost_base { "ssl_$blog_domain":
            use_ssl => true,
            vhost => $blog_domain,
            location => $blog_location,
            content => template('blog/blogs_vhosts.conf'),
        }

        file { "$blog_location":
	        ensure => directory,
	        owner => apache,
	        group => apache,
	        mode => 644,
        }
    }
}