Puppet Class: puppetserver::g10k

Defined in:
modules/puppetserver/manifests/g10k.pp

Summary

install and manage g10k

Overview

SPDX-License-Identifier: Apache-2.0

Parameters:

  • ensure (Wmflib::Ensure) (defaults to: 'present')

    ensureable param

  • config_file (Stdlib::Unixpath) (defaults to: '/etc/puppet/g10k.conf')

    path to the config file

  • cache_dir (Stdlib::Unixpath) (defaults to: '/var/cache/g10k')

    path to the cache directory

  • sources (Hash[String, Puppetmaster::R10k::Source]) (defaults to: {})

    list of sources to configure



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

class puppetserver::g10k (
    Wmflib::Ensure                           $ensure      = 'present',
    Stdlib::Unixpath                         $config_file = '/etc/puppet/g10k.conf',
    Stdlib::Unixpath                         $cache_dir   = '/var/cache/g10k',
    Hash[String, Puppetmaster::R10k::Source] $sources     = {},
) {
    ensure_packages('g10k')
    $_sources =  Hash($sources.map |$items| {
        [$items[0], { 'basedir' => "${puppetserver::environments_dir}_staging" } + $items[1]]
    })
    $config = {
        'cachedir' => $cache_dir,
        'sources'  => $_sources,
    }
    file { $cache_dir:
        ensure => stdlib::ensure($ensure, 'directory'),
    }
    file { $config_file:
        ensure  => stdlib::ensure($ensure, file),
        content => $config.to_yaml,
    }
}