Puppet Class: profile::ores::redis

Defined in:
modules/profile/manifests/ores/redis.pp

Overview

Setting up ORES Redis database in a replicated way in order to facilitate failover if required

Parameters:

  • password (Any) (defaults to: hiera('profile::ores::redis::password'))
  • redis_clients (Any) (defaults to: hiera('profile::ores::redis::client_hosts'))
  • slaveof (Any) (defaults to: hiera('profile::ores::redis::slaveof', undef))
  • prometheus_nodes (Any) (defaults to: hiera('prometheus_nodes'))


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
# File 'modules/profile/manifests/ores/redis.pp', line 3

class profile::ores::redis(
    $password = hiera('profile::ores::redis::password'),
    $redis_clients = hiera('profile::ores::redis::client_hosts'),
    $slaveof  = hiera('profile::ores::redis::slaveof', undef),
    $prometheus_nodes = hiera('prometheus_nodes'),
){
    include ::standard
    include ::profile::base::firewall

    $instances = ['6379', '6380']

    class { '::ores::redis':
        password => $password,
        slaveof  => $slaveof,
    }

    ::profile::prometheus::redis_exporter{ $instances:
        password         => $password,
        prometheus_nodes => $prometheus_nodes,
        arguments        => '-check-keys celery',
    }

    $redis_hosts_ferm = join($redis_clients, ' ')
    $redis_ports_ferm = join($instances, ' ')
    ferm::service { 'ores_redis':
        proto  => 'tcp',
        port   => "(${redis_ports_ferm})",
        srange => "@resolve((${redis_hosts_ferm}))",
    }
}