Puppet Class: profile::thumbor

Defined in:
modules/profile/manifests/thumbor.pp

Overview

Parameters:

  • memcached_servers (Array[Stdlib::Host]) (defaults to: lookup('thumbor_memcached_servers'))
  • memcached_servers_nutcracker (Array[String]) (defaults to: lookup('thumbor_memcached_servers_nutcracker'))
  • logstash_port (Stdlib::Port) (defaults to: lookup('logstash_logback_port'))
  • swift_sharded_containers (Array[String]) (defaults to: lookup('profile::swift::proxy::shard_container_list', {'merge' => 'unique'}))
  • swift_private_containers (Array[String]) (defaults to: lookup('profile::swift::proxy::private_container_list', {'merge' => 'unique'}))
  • thumbor_mediawiki_shared_secret (String) (defaults to: lookup('thumbor::mediawiki::shared_secret'))
  • statsd_port (Stdlib::Port) (defaults to: lookup('statsd_exporter_port'))
  • swift_account_keys (Hash) (defaults to: lookup('profile::swift::accounts_keys'))


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
# File 'modules/profile/manifests/thumbor.pp', line 1

class profile::thumbor(
    Array[Stdlib::Host] $memcached_servers = lookup('thumbor_memcached_servers'),
    Array[String] $memcached_servers_nutcracker = lookup('thumbor_memcached_servers_nutcracker'),
    Stdlib::Port $logstash_port = lookup('logstash_logback_port'),
    Array[String] $swift_sharded_containers = lookup('profile::swift::proxy::shard_container_list', {'merge' => 'unique'}),
    Array[String] $swift_private_containers = lookup('profile::swift::proxy::private_container_list', {'merge' => 'unique'}),
    String $thumbor_mediawiki_shared_secret = lookup('thumbor::mediawiki::shared_secret'),
    Stdlib::Port $statsd_port = lookup('statsd_exporter_port'),
    Hash $swift_account_keys = lookup('profile::swift::accounts_keys'),
){
    require profile::base::memory_cgroup
    include ::profile::conftool::client
    class { 'conftool::scripts': }

    class { '::thumbor::nutcracker':
        thumbor_memcached_servers => $memcached_servers_nutcracker,
    }

    # rsyslog forwards json messages sent to localhost along to logstash via kafka
    class { '::profile::rsyslog::udp_json_logback_compat':
        port => $logstash_port,
    }

    class { '::thumbor':
        logstash_host => 'localhost',
        logstash_port => $logstash_port,
        statsd_port   => $statsd_port,
    }

    class { '::thumbor::swift':
        swift_key                       => $swift_account_keys['mw_thumbor'],
        swift_private_key               => $swift_account_keys['mw_thumbor-private'],
        swift_sharded_containers        => $swift_sharded_containers,
        swift_private_containers        => $swift_private_containers,
        thumbor_mediawiki_shared_secret => $thumbor_mediawiki_shared_secret,
    }

    ferm::service { 'thumbor':
        proto  => 'tcp',
        port   => '8800',
        srange => '$DOMAIN_NETWORKS',
    }

    $thumbor_memcached_servers_ferm = join($memcached_servers, ' ')

    ferm::service { 'memcached_memcached_role':
        proto  => 'tcp',
        port   => '11211',
        srange => "(@resolve((${thumbor_memcached_servers_ferm})))",
    }
}