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
$https_proxy - set proxy to be used for downloading feeds
example: http://url-downloader.${::site}.wikimedia.org:8080
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 |
# File 'modules/planet/manifests/init.pp', line 18
class planet (
Stdlib::Fqdn $domain_name,
Hash $languages,
Stdlib::Httpsurl $meta_link,
Stdlib::Httpurl $https_proxy,
Wmflib::Ensure $updatejob_ensure,
) {
# things done once for all planet per languages
include ::planet::packages
include ::planet::dirs
systemd::sysuser { 'planet':
description => 'planet_RSS_aggregator',
home_dir => '/var/lib/planet',
}
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,
}
profile::auto_restarts::service { 'apache2': }
profile::auto_restarts::service { 'envoyproxy': }
# creates one RSS/Atom feed config per language
planet::config { $languages_keys:
domain_name => $domain_name,
}
# creates one systemd timer for updates per language
# all run hourly but each language at a different random minute
planet::updatejob { $languages_keys:
ensure => $updatejob_ensure,
https_proxy => $https_proxy,
}
# creates one planet theme (css/logo) per language
planet::theme { $languages_keys: }
}
|