Defined Type: base::puppet::config

Defined in:
modules/base/manifests/puppet/config.pp

Overview

Definition base::puppet::config Populate a puppet config file and notify the compilation process

Parameters:

  • ensure (Any) (defaults to: 'present')
  • prio (Any) (defaults to: 10)
  • content (Any) (defaults to: undef)
  • source (Any) (defaults to: undef)


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

define base::puppet::config(
        $ensure='present',
        $prio=10,
        $content=undef,
        $source=undef,
) {
    if $source == undef and $content == undef  {
        fail('you must provide either "source" or "content"')
    }
    $title_safe = regsubst($title, '[\W_]', '-', 'G')
    $conf_file = sprintf('%02d-%s.conf', $prio, $title_safe)

    file { "/etc/puppet/puppet.conf.d/${conf_file}":
        ensure  => $ensure,
        content => $content,
        source  => $source,
        owner   => 'root',
        group   => 'root',
        mode    => '0444',
        notify  => Exec['compile puppet.conf'],
    }
}