feat: change g10k to use a package #304
@ -27,7 +27,7 @@ profiles::puppet::cobbler_enc::packages:
|
||||
- 'PyYAML'
|
||||
profiles::puppet::enc::repo: https://git.service.au-syd1.consul/unkinben/puppet-enc.git
|
||||
profiles::puppet::r10k::r10k_repo: https://git.service.au-syd1.consul/unkin/puppet-r10k.git
|
||||
profiles::puppet::g10k::bin_path: '/opt/puppetlabs/bin/g10k'
|
||||
profiles::puppet::g10k::bin_path: '/usr/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'
|
||||
|
||||
@ -1,25 +1,14 @@
|
||||
# Class: profiles::puppet::g10k
|
||||
#
|
||||
# This class handles downloading and installation of the g10k tool, a fast
|
||||
# Git and Forge based Puppet environment and module deployment tool.
|
||||
# The latest release of g10k is downloaded from GitHub and placed into '/opt/puppetlabs/bin'.
|
||||
# Additionally, it creates a helper script to easily run g10k with the appropriate configuration.
|
||||
# It also creates a systemd service and timer that runs the g10k script every minute.
|
||||
class profiles::puppet::g10k (
|
||||
String $bin_path,
|
||||
String $cfg_path,
|
||||
String $environments_path,
|
||||
String $default_environment,
|
||||
Stdlib::Absolutepath $bin_path = '/usr/bin/g10k',
|
||||
Stdlib::Absolutepath $cfg_path = '/etc/puppetlabs/r10k/r10k.yaml',
|
||||
Stdlib::Absolutepath $environments_path = '/etc/puppetlabs/code/environments',
|
||||
String $default_environment = 'develop',
|
||||
){
|
||||
|
||||
archive { '/tmp/g10k.zip':
|
||||
ensure => present,
|
||||
source => 'https://github.com/xorpaul/g10k/releases/latest/download/g10k-linux-amd64.zip',
|
||||
extract => true,
|
||||
extract_path => '/opt/puppetlabs/bin',
|
||||
creates => '/opt/puppetlabs/bin/g10k',
|
||||
cleanup => true,
|
||||
require => Package['unzip']
|
||||
package {'g10k':
|
||||
ensure => 'latest',
|
||||
}
|
||||
|
||||
file { '/opt/puppetlabs/bin/puppet-g10k':
|
||||
@ -28,7 +17,7 @@ class profiles::puppet::g10k (
|
||||
group => 'root',
|
||||
mode => '0755',
|
||||
content => template('profiles/puppet/g10k/puppet-g10k.erb'),
|
||||
require => Archive['/tmp/g10k.zip'],
|
||||
require => Package['g10k'],
|
||||
}
|
||||
|
||||
$_timer = @(EOT)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user