aboutsummaryrefslogtreecommitdiffstats
path: root/deployment/websites/manifests/init.pp
blob: d2119224c9574bb97bf681955acbdb04e42c9760 (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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
class websites {
    class base {
       $webdatadir = '/var/www/vhosts'
    }

    # vhost to host static files used by web sites
    class static inherits base {
        $vhostdir = "$webdatadir/static.$domain"
	$svn_location = "svn://svn.$domain/svn/web/www/trunk/g/"
    	apache::vhost_other_app { "static.$domain":
	    vhost_file => 'websites/vhost_static.conf',
	}

	file { $vhostdir:
	    ensure => directory,
	    mode => 655,
	}

	subversion::snapshot { "$vhostdir/g":
	    source => $svn_location
	}
    }

    class hugs inherits base {
        $vhostdir = "$webdatadir/hugs.$domain"
	$svn_location = "svn://svn.$domain/svn/web/hugs/public/"
    	apache::vhost_base { "hugs.$domain":
	    location => $vhostdir,
	}

	subversion::snapshot { "$vhostdir":
	    source => $svn_location
	}

	package { php-exif:
	    ensure => "installed",
	}
    }

    class releases inherits base {
        $vhostdir = "$webdatadir/releases.$domain"
	$svn_location = "svn://svn.$domain/svn/web/releases/"
    	apache::vhost_base { "releases.$domain":
	    location => $vhostdir,
	    options => [ "FollowSymLinks" ]
	}
    	apache::vhost_base { "ssl_releases.$domain":
	    vhost => "releases.$domain",
	    use_ssl => true,
	    location => $vhostdir,
	    options => [ "FollowSymLinks" ]
	}

	subversion::snapshot { "$vhostdir":
	    source => $svn_location
	}
    }

    class www_outage {
	apache::vhost_redirect { "www.$domain":
	    url => 'http://blog.mageia.org/en/2011/12/19/server-outage/#'
	}
	apache::vhost_redirect { "$domain":
	    url => 'http://blog.mageia.org/en/2011/12/19/server-outage/#'
	}
    }

    class svn {
        apache::vhost_redirect { "svn.$domain":
            url => "http://svnweb.$domain/",
        }
    }

    class forum_proxy {

        $web_domain = "forums.$domain"
        host { "$web_domain":
            ip => '192.168.122.131',
            ensure => 'present',
        }

        apache::vhost_reverse_proxy { "$web_domain":
            url => "http://$web_domain/",
        } 

        apache::vhost_reverse_proxy { "ssl_$web_domain":
            vhost => $web_domain,
            use_ssl => true,
            url => "http://$web_domain/",
        } 
    }

    class pkgcpan inherits base {
        $vhost = "pkgcpan.$domain"
        $vhostdir = "$webdatadir/$vhost"

    	apache::vhost_base { "$vhost":
	    location => $vhostdir,
	    options => [ "Indexes" ]
	}                
        
        file { $vhostdir:
            ensure => directory,
        }

        package { "perl-Module-Packaged-Generator":
            ensure => installed,        
        }
        
        cron { "update cpanpkg":
            hour => 23,
            require => Package['perl-Module-Packaged-Generator'],
            command => "pkgcpan -q -f $vhostdir/cpan_Mageia.db -d Mageia",
        }
    }
}