Puppet Class: psick::puppet::ci

Defined in:
manifests/puppet/ci.pp

Overview

Manages /etc/puppetlabs/ci/ files, used by Puppet CI scripts under Psickā€™s control-repo bin directory This file contains the names of the node where to run specific Puppet CI steps.

Parameters:

  • ensure (String) (defaults to: 'present')
  • config_dir_path (String) (defaults to: '/etc/puppetlabs/ci')
  • production_nodes_noop (Array) (defaults to: [])
  • production_nodes_no_noop (Array) (defaults to: [])
  • canary_nodes_noop (Array) (defaults to: [])
  • canary_nodes_no_noop (Array) (defaults to: [])
  • diff_nodes (Array) (defaults to: [])
  • manage (Boolean) (defaults to: $psick::manage)
  • noop_manage (Boolean) (defaults to: $psick::noop_manage)
  • noop_value (Boolean) (defaults to: $psick::noop_value)
  • modules (Array) (defaults to: [])
  • modules_user (String) (defaults to: 'root')


5
6
7
8
9
10
11
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
# File 'manifests/puppet/ci.pp', line 5

class psick::puppet::ci (
  String                $ensure           = 'present',
  String                $config_dir_path   = '/etc/puppetlabs/ci',
  Array                 $production_nodes_noop    = [],
  Array                 $production_nodes_no_noop = [],
  Array                 $canary_nodes_noop        = [],
  Array                 $canary_nodes_no_noop     = [],
  Array                 $diff_nodes               = [],
  Boolean $manage                  = $psick::manage,
  Boolean $noop_manage             = $psick::noop_manage,
  Boolean $noop_value              = $psick::noop_value,
  Array $modules                                  = [],
  String $modules_user                            = 'root',
) {
  if $manage {
    if $noop_manage {
      noop($noop_value)
    }
    file { $config_dir_path:
      ensure => directory,
      mode   => '0755',
    }
    if $production_nodes_noop != [] {
      file { "${config_dir_path}/production_nodes_noop.txt":
        ensure  => $ensure,
        content => join($production_nodes_noop,"\n"),
      }
    }
    if $production_nodes_no_noop != [] {
      file { "${config_dir_path}/production_nodes_no_noop.txt":
        ensure  => $ensure,
        content => join($production_nodes_no_noop,"\n"),
      }
    }
    if $canary_nodes_noop != [] {
      file { "${config_dir_path}/canary_nodes_noop.txt":
        ensure  => $ensure,
        content => join($canary_nodes_noop,"\n"),
      }
    }
    if $canary_nodes_no_noop != [] {
      file { "${config_dir_path}/canary_nodes_no_noop.txt":
        ensure  => $ensure,
        content => join($canary_nodes_no_noop,"\n"),
      }
    }
    if $diff_nodes != [] {
      file { "${config_dir_path}/diff_nodes.txt":
        ensure  => $ensure,
        content => join($diff_nodes,"\n"),
      }
    }
    if $modules != [] {
      $modules.each | $m | {
        psick::puppet::module { $m:
          user   => $modules_user,
        }
      }
    }
  }
}