Merge pull request 'Adding a default environment' (#22) from feature/default_environment into develop
Reviewed-on: unkinben/puppet-prod#22
This commit is contained in:
commit
ea7561a093
@ -32,3 +32,7 @@ profiles::puppet::autosign::domains:
|
|||||||
|
|
||||||
profiles::puppet::enc::enc_repo: https://git.unkin.net/unkinben/puppet-enc.git
|
profiles::puppet::enc::enc_repo: https://git.unkin.net/unkinben/puppet-enc.git
|
||||||
profiles::puppet::r10k::r10k_repo: https://git.unkin.net/unkinben/puppet-r10k.git
|
profiles::puppet::r10k::r10k_repo: https://git.unkin.net/unkinben/puppet-r10k.git
|
||||||
|
profiles::puppet::g10k::bin_path: '/opt/puppetlabs/bin/g10k'
|
||||||
|
profiles::puppet::g10k::cfg_path: '/etc/puppetlabs/r10k/r10k.yaml'
|
||||||
|
profiles::puppet::g10k::environments_path: '/etc/puppetlabs/code/environments'
|
||||||
|
profiles::puppet::g10k::default_environment: 'develop'
|
||||||
|
|||||||
@ -30,8 +30,12 @@
|
|||||||
#
|
#
|
||||||
# Limitations:
|
# Limitations:
|
||||||
# This is designed to work on Unix-like systems only.
|
# This is designed to work on Unix-like systems only.
|
||||||
class profiles::puppet::g10k {
|
class profiles::puppet::g10k (
|
||||||
|
String $bin_path,
|
||||||
|
String $cfg_path,
|
||||||
|
String $environments_path,
|
||||||
|
String $default_environment,
|
||||||
|
){
|
||||||
package { 'unzip':
|
package { 'unzip':
|
||||||
ensure => installed,
|
ensure => installed,
|
||||||
}
|
}
|
||||||
@ -50,7 +54,7 @@ class profiles::puppet::g10k {
|
|||||||
owner => 'root',
|
owner => 'root',
|
||||||
group => 'root',
|
group => 'root',
|
||||||
mode => '0755',
|
mode => '0755',
|
||||||
content => "#!/usr/bin/bash\n/opt/puppetlabs/bin/g10k -config /etc/puppetlabs/r10k/r10k.yaml\n",
|
content => template('profiles/puppet/g10k/puppet-g10k.erb'),
|
||||||
require => Archive['/tmp/g10k.zip'],
|
require => Archive['/tmp/g10k.zip'],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -47,5 +47,7 @@ class profiles::puppet::puppetmaster {
|
|||||||
node_terminus => 'exec',
|
node_terminus => 'exec',
|
||||||
external_nodes => '/opt/puppetlabs/bin/enc',
|
external_nodes => '/opt/puppetlabs/bin/enc',
|
||||||
autosign => '/etc/puppetlabs/puppet/autosign.conf',
|
autosign => '/etc/puppetlabs/puppet/autosign.conf',
|
||||||
|
default_manifest => '/etc/puppetlabs/code/environments/develop/manifests',
|
||||||
|
default_environment => 'develop',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -25,6 +25,8 @@ class profiles::puppet::server (
|
|||||||
String $node_terminus,
|
String $node_terminus,
|
||||||
String $external_nodes,
|
String $external_nodes,
|
||||||
String $autosign,
|
String $autosign,
|
||||||
|
String $default_manifest,
|
||||||
|
String $default_environment,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
file { '/etc/puppetlabs/puppet/puppet.conf':
|
file { '/etc/puppetlabs/puppet/puppet.conf':
|
||||||
@ -43,6 +45,8 @@ class profiles::puppet::server (
|
|||||||
'node_terminus' => $node_terminus,
|
'node_terminus' => $node_terminus,
|
||||||
'external_nodes' => $external_nodes,
|
'external_nodes' => $external_nodes,
|
||||||
'autosign' => $autosign,
|
'autosign' => $autosign,
|
||||||
|
'default_manifest' => $default_manifest,
|
||||||
|
'default_environment' => $default_environment,
|
||||||
}),
|
}),
|
||||||
notify => Service['puppetserver'],
|
notify => Service['puppetserver'],
|
||||||
}
|
}
|
||||||
|
|||||||
4
site/profiles/templates/puppet/g10k/puppet-g10k.erb
Normal file
4
site/profiles/templates/puppet/g10k/puppet-g10k.erb
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
#!/usr/bin/bash
|
||||||
|
<%= @bin_path %> -config <%= @cfg_path %>
|
||||||
|
rm -f <%= @environments_path %>/production
|
||||||
|
ln -s <%= @environments_path %>/<%= @default_environment %> <%= @environments_path %>/production
|
||||||
@ -15,3 +15,5 @@ server = <%= $server %>
|
|||||||
node_terminus = exec
|
node_terminus = exec
|
||||||
external_nodes = <%= $external_nodes %>
|
external_nodes = <%= $external_nodes %>
|
||||||
autosign = <%= $autosign %>
|
autosign = <%= $autosign %>
|
||||||
|
default_manifest = <%= $default_manifest %>
|
||||||
|
default_environment = <%= $default_environment %>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user