Puppet Class: redis::multidc::ipsec

Defined in:
modules/redis/manifests/multidc/ipsec.pp

Overview

class redis::multidc::ipsec

Parameters:

  • shards (Any)


2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'modules/redis/manifests/multidc/ipsec.pp', line 2

class redis::multidc::ipsec($shards) {
    #################################################################
    # Set up IPsec between hosts (for encrypting the redis replica) #
    #################################################################

    $my_ip = $facts['networking']['ip']
    $myshards = $shards.reduce([]) |$memo, $values| {
        $memo + $values[1].filter |$key, $value| { $value['host'] == $my_ip }.keys
    }
    $ipsec_host_list = $shards.reduce([]) |$memo, $values| {
        $memo + $values[1].filter |$key, $value| {
            $key in $myshards
        }.map |$key, $value| {
            ipresolve($value['host'], 'ptr')
        }
    }.sort.unique

    # No reason to define IPsec if the host doesn't need replication.
    if size($ipsec_host_list) > 0 {
        class { '::role::ipsec':
            hosts => $ipsec_host_list,
        }
    }
}