Puppet Class: spicerack

Defined in:
modules/spicerack/manifests/init.pp

Summary

Installs the spicerack library and cookbook entry point and their configuration.

Overview

SPDX-License-Identifier: Apache-2.0

Parameters:

  • tcpircbot_host (String)

    Hostname for the IRC bot.

  • tcpircbot_port (Stdlib::Port)

    Port to use with the IRC bot.

  • http_proxy (String)

    a http_proxy to use for connections

  • etcd_config (Optional[Stdlib::Unixpath]) (defaults to: undef)

    the path to the etcd configuration to use for distributed locking

  • cookbooks_dirs (Array[String])

    a list of paths where cookbooks have been checked out

  • modules (Hash)

    a hash where the keys are the spicerack module names and the values are hashes where keys are the file names and values is the file content to be converted to yaml.



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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'modules/spicerack/manifests/init.pp', line 12

class spicerack (
    String                     $tcpircbot_host,
    Stdlib::Port               $tcpircbot_port,
    String                     $http_proxy,
    Array[String]              $cookbooks_dirs,
    Hash                       $modules,
    Optional[Stdlib::Unixpath] $etcd_config = undef,
) {
    ensure_packages('spicerack')

    # this directory is created by the debian package however we still manage it to force
    # an auto require on all files under this directory
    file { '/etc/spicerack':
        ensure => directory,
        owner  => 'root',
        group  => 'ops',
        mode   => '0550',
    }

    file { '/etc/spicerack/config.yaml':
        ensure  => file,
        owner   => 'root',
        group   => 'ops',
        mode    => '0440',
        content => template('spicerack/config.yaml.erb'),
    }

    ### SPICERACK MODULES CONFIGURATION FILES

    $modules.each | $module, $file_data | {
        file { "/etc/spicerack/${module}":
            ensure => directory,
            owner  => 'root',
            group  => 'ops',
            mode   => '0550',
        }
        $file_data.each | $filename, $content | {
            file { "/etc/spicerack/${module}/${filename}":
                ensure  => file,
                owner   => 'root',
                group   => 'ops',
                mode    => '0440',
                content => $content.to_yaml,
            }
        }
    }

    ### COOKBOOKS CONFIGURATION FILES

    file { '/etc/spicerack/cookbooks':
        ensure => directory,
        owner  => 'root',
        group  => 'ops',
        mode   => '0550',
    }

}