aboutsummaryrefslogtreecommitdiffstats
path: root/modules/planet/manifests/init.pp
blob: b9cfb29f6f9ab7bd3312539762da1780d917677e (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 planet {

    user { 'planet':
        groups  => 'apache',
        comment => 'Planet Mageia',
        home    => '/var/lib/planet',
    }

    $vhost = "planet.$::domain"
    $location = "/var/www/vhosts/$vhost"
	
    include apache::mod::php
    include apache::mod::deflate

    apache::vhost::base { $vhost:
        location => $location,
        content  => template('planet/planet_vhosts.conf')
    }

    apache::vhost::base { "ssl_$vhost":
        use_ssl  => true,
        vhost    => $vhost,
        location => $location,
        content  => template('planet/planet_vhosts.conf')
    }

    mga_common::local_script { 'deploy_new-planet.sh':
        content => template('planet/deploy_new-planet.sh')
    }

    file { $location:
        ensure => directory,
    }

    file { "$location/index.php":
        content => template('planet/index.php')
    }

    package { ['php-iconv']: }    

    class files_backup inherits base {
        file { "/var/lib/planet/backup":
                ensure => directory,
        }

        mga_common::local_script { "backup_planet-files.sh":
            content => template("blog/backup_planet-files.sh")
        }

        cron { "Backup files (planet)":
            user => root,
            hour => '23',
            minute => '42',
            command => "/usr/local/bin/backup_planet-files.sh",
            require => [File["backup_planet-files"]],
        }
    }
}