Puppet Class: cacheproxy::traffic_pool

Defined in:
modules/cacheproxy/manifests/traffic_pool.pp

Overview

SPDX-License-Identifier: Apache-2.0

Class cacheproxy::traffic_pool

Manages pooling/depooling of servers in conftool upon startup/shutdown.



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'modules/cacheproxy/manifests/traffic_pool.pp', line 8

class cacheproxy::traffic_pool {
    $varlib_path = '/var/lib/traffic-pool'
    # note: we can't use 'service' because we don't want to 'ensure =>
    # stopped|running', but we still need to enable it
    systemd::unit { 'traffic-pool.service':
        ensure  => present,
        content => template('cacheproxy/traffic-pool.service.erb'),
    }

    file { $varlib_path:
        ensure => directory,
        mode   => '0755',
        owner  => 'root',
        group  => 'root',
    }

    exec { 'systemd enable traffic-pool':
        command => '/bin/systemctl enable traffic-pool.service',
        unless  => '/bin/systemctl is-enabled traffic-pool.service',
        require => [Systemd::Unit['traffic-pool.service'],File[$varlib_path]]
    }
}