Puppet Class: planet

Defined in:
modules/planet/manifests/init.pp

Overview

planet RSS feed aggregator 3.0 (rawdog) this sets up multiple Planet Wikimedia feed aggregators see meta.wikimedia.org/wiki/Planet_Wikimedia planet.wikimedia.org/

see role/planet.pp for language and translation config

required parameters:

$domain_name - domain name used in Apache/SSL configs

example "planet.wikimedia.org

$languages - a hash with languages and UI translations

see the role class for this

$meta_link - https:// link

example: meta.wikimedia.org/wiki/Planet_Wikimedia

$http_proxy - set proxy to be used for downloading feeds

example: http://url-downloader.${::site}.wikimedia.org:8080

Parameters:

  • domain_name (Stdlib::Fqdn)
  • languages (Hash)
  • meta_link (Stdlib::Httpsurl)
  • http_proxy (Stdlib::Httpurl)


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
# File 'modules/planet/manifests/init.pp', line 18

class planet (
    Stdlib::Fqdn $domain_name,
    Hash $languages,
    Stdlib::Httpsurl $meta_link,
    Stdlib::Httpurl $http_proxy,
) {

    # things done once for all planet per languages
    include ::planet::packages
    include ::planet::dirs
    include ::planet::user

    class { '::planet::index_site':
        domain_name => $domain_name,
        meta_link   => $meta_link,
    }

    $logo_file = '/var/www/planet/planet-wm2.png'

    # TODO change this to be one per language
    file { $logo_file:
        source => 'puppet:///modules/planet/theme/images/planet-wm2.png',
        owner  => 'planet',
        group  => 'www-data',
    }

    # things done per each language version
    # we iterate over the keys of the hash
    # which includes language names and translations
    $languages_keys = keys($languages)
    # creates one document root per language
    planet::docroot { $languages_keys: }

    # creates one Apache VirtualHost per language
    planet::apachesite { $languages_keys:
        domain_name => $domain_name,
    }

    # creates one RSS/Atom feed config per language
    planet::config { $languages_keys:
        domain_name => $domain_name,
    }

    # creates one cron for updates per language
    planet::cronjob { $languages_keys: }

    # creates one planet theme (css/logo) per language
    planet::theme { $languages_keys: }

    if os_version('debian >= stretch') {
      # creates RSS dir and plugin per language
      planet::rawdogplugin { $languages_keys: }
    }
}