Puppet Class: puppet::r10k::config
- Inherits:
- puppet::params
- Defined in:
- manifests/r10k/config.pp
Summary
Default r10k configuration fileOverview
The r10k configuration file is created only if r10k.yaml does not already exist. By default, it establishes the ‘production` environment. Optionally, it can also configure `common` and `enc` environments.
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 |
# File 'manifests/r10k/config.pp', line 49
class puppet::r10k::config (
String $r10k_yaml_template = $puppet::r10k_yaml_template,
Stdlib::Absolutepath $cachedir = $puppet::params::r10k_cachedir,
Stdlib::Absolutepath $environmentpath = $puppet::params::environmentpath,
Boolean $r10k_config_setup = $puppet::r10k_config_setup,
String $production_remote = $puppet::production_remote,
Boolean $use_common_env = $puppet::use_common_env,
String $common_remote = $puppet::common_remote,
Boolean $use_enc = $puppet::use_enc,
String $enc_remote = $puppet::enc_remote,
) inherits puppet::params {
include puppet::r10k::setup
# /opt/puppetlabs/puppet/cache/r10k
$r10k_vardir = "${facts['puppet_vardir']}/r10k"
$r10k_config_file = $puppet::params::r10k_config_file
# this should be one time installation
file { "${r10k_vardir}/r10k.yaml":
content => template($r10k_yaml_template),
mode => '0600',
owner => 'root',
group => 'root',
notify => Exec['r10k-config'],
}
if $r10k_config_setup {
# only if ${r10k_vardir}/r10k.yaml just created or changed
exec { 'r10k-config':
command => "cp ${r10k_vardir}/r10k.yaml ${r10k_config_file}",
refreshonly => true,
path => '/bin:/usr/bin',
}
}
else {
# only if config file not exists
exec { 'r10k-config':
command => "cp ${r10k_vardir}/r10k.yaml ${r10k_config_file}",
creates => $r10k_config_file,
path => '/bin:/usr/bin',
}
}
Class['puppet::r10k::setup'] -> File["${r10k_vardir}/r10k.yaml"]
Class['puppet::r10k::setup'] -> Exec['r10k-config']
}
|