Puppet Class: puppet::profile::r10k

Defined in:
manifests/profile/r10k.pp

Overview

Parameters:

  • remote (Any) (defaults to: undef)
  • sources (Any) (defaults to: undef)
  • cachedir (Any) (defaults to: undef)
  • configfile (Any) (defaults to: undef)
  • version (Any) (defaults to: undef)
  • modulepath (Any) (defaults to: undef)
  • manage_modulepath (Any) (defaults to: undef)
  • manage_ruby_dependency (Any) (defaults to: false)
  • r10k_basedir (Any) (defaults to: undef)
  • package_name (Any) (defaults to: undef)
  • provider (Any) (defaults to: undef)
  • gentoo_keywords (Any) (defaults to: undef)
  • install_options (Any) (defaults to: undef)
  • mcollective (Any) (defaults to: false)
  • manage_configfile_symlink (Any) (defaults to: false)
  • configfile_symlink (Any) (defaults to: undef)
  • include_prerun_command (Any) (defaults to: false)
  • include_postrun_command (Any) (defaults to: false)
  • env_owner (Any) (defaults to: 'root')
  • r10k_minutes (Any) (defaults to: [ 0, 15, 30, 45])
  • r10k_update (Any) (defaults to: true)
  • r10k_update_env (Any) (defaults to: 'production')


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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# File 'manifests/profile/r10k.pp', line 29

class puppet::profile::r10k (
  $remote                    = undef,
  $sources                   = undef,
  $cachedir                  = undef,
  $configfile                = undef,
  $version                   = undef,
  $modulepath                = undef,
  $manage_modulepath         = undef,
  $manage_ruby_dependency    = false,
  $r10k_basedir              = undef,
  $package_name              = undef,
  $provider                  = undef,
  $gentoo_keywords           = undef,
  $install_options           = undef,
  $mcollective               = false,
  $manage_configfile_symlink = false,
  $configfile_symlink        = undef,
  $include_prerun_command    = false,
  $include_postrun_command   = false,
  $env_owner                 = 'root',
  $r10k_minutes              = [
    0,
    15,
    30,
    45],
  $r10k_update               = true,
  $r10k_update_env           = 'production',
) {

  include ::puppet::defaults
  $codedir = $::puppet::defaults::codedir

  case $r10k_basedir {
    default: {
      $real_r10k_basedir = $r10k_basedir
    }
    undef: {
      $real_r10k_basedir = "${codedir}/environments"
    }
  }

  case $r10k_update {
    default: {
      $r10k_cron_ensure = present
    }
    false: {
      $r10k_cron_ensure = absent
    }
  }

  class { '::r10k':
    remote                    => $remote,
    sources                   => $sources,
    cachedir                  => $cachedir,
    configfile                => $configfile,
    version                   => $version,
    modulepath                => $modulepath,
    manage_modulepath         => $manage_modulepath,
    manage_ruby_dependency    => $manage_ruby_dependency,
    r10k_basedir              => $real_r10k_basedir,
    package_name              => $package_name,
    provider                  => $provider,
    gentoo_keywords           => $gentoo_keywords,
    install_options           => $install_options,
    mcollective               => $mcollective,
    manage_configfile_symlink => $manage_configfile_symlink,
    configfile_symlink        => $configfile_symlink,
    include_prerun_command    => $include_prerun_command,
    include_postrun_command   => $include_postrun_command,
  }

  # cron for updating the r10k environment
  cron { 'puppet_r10k':
    ensure      => $r10k_cron_ensure,
    command     => "r10k deploy environment ${r10k_update_env} -p",
    environment => 'PATH=/usr/local/bin:/bin:/usr/bin:/usr/sbin',
    user        => $env_owner,
    minute      => $r10k_minutes
  }
}