|
|
|
@@ -1,20 +1,15 @@
|
|
|
|
|
# profiles::puppet::agent
|
|
|
|
|
# This class manages Puppet agent package and service.
|
|
|
|
|
class profiles::puppet::agent (
|
|
|
|
|
String $version = 'latest',
|
|
|
|
|
Boolean $openvox_enable = false,
|
|
|
|
|
String $version = 'latest',
|
|
|
|
|
) {
|
|
|
|
|
|
|
|
|
|
# set openvox package, yumrepo, service
|
|
|
|
|
if $openvox_enable {
|
|
|
|
|
$use_package = 'openvox-agent'
|
|
|
|
|
$use_yumrepo = 'openvox'
|
|
|
|
|
$use_service = 'puppet'
|
|
|
|
|
}else{
|
|
|
|
|
$use_package = 'puppet-agent'
|
|
|
|
|
$use_yumrepo = 'puppet'
|
|
|
|
|
$use_service = 'puppet'
|
|
|
|
|
# RedHat-family installs OpenVox from artifactapi; Debian installs puppet-agent via apt
|
|
|
|
|
$use_package = $facts['os']['family'] ? {
|
|
|
|
|
'RedHat' => 'openvox-agent',
|
|
|
|
|
default => 'puppet-agent',
|
|
|
|
|
}
|
|
|
|
|
$use_service = 'puppet'
|
|
|
|
|
|
|
|
|
|
# OpenVox publishes RedHat-family builds per distribution: enterprise-linux
|
|
|
|
|
# under el/<major>, Fedora under fedora/<major>.
|
|
|
|
@@ -23,8 +18,7 @@ class profiles::puppet::agent (
|
|
|
|
|
default => 'el',
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# manage the yumrepo for the given package
|
|
|
|
|
if $openvox_enable and $facts['os']['family'] == 'RedHat' {
|
|
|
|
|
if $facts['os']['family'] == 'RedHat' {
|
|
|
|
|
yumrepo { 'openvox':
|
|
|
|
|
ensure => 'present',
|
|
|
|
|
baseurl => "https://artifactapi.k8s.syd1.au.unkin.net/api/v1/remote/openvox/openvox7/${openvox_dist}/${facts['os']['release']['major']}/${facts['os']['architecture']}/",
|
|
|
|
@@ -32,14 +26,6 @@ class profiles::puppet::agent (
|
|
|
|
|
gpgkey => 'https://artifactapi.k8s.syd1.au.unkin.net/api/v1/remote/openvox/GPG-KEY-openvox.pub',
|
|
|
|
|
notify => Exec['dnf_makecache'],
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
yumrepo { 'puppet':
|
|
|
|
|
ensure => 'present',
|
|
|
|
|
baseurl => "https://packagerepo.service.consul/puppet7/el/${facts['os']['release']['major']}-daily/${facts['os']['architecture']}/os/",
|
|
|
|
|
descr => 'puppet repository',
|
|
|
|
|
gpgkey => "https://packagerepo.service.consul/puppet7/el/${facts['os']['release']['major']}-daily/${facts['os']['architecture']}/os/RPM-GPG-KEY-puppet-20250406",
|
|
|
|
|
notify => Exec['dnf_makecache'],
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# if agent-version is anything other than latest, set a versionlock
|
|
|
|
@@ -57,7 +43,7 @@ class profiles::puppet::agent (
|
|
|
|
|
# Ensure the agent package is installed and locked to a specific version
|
|
|
|
|
package { $use_package:
|
|
|
|
|
ensure => $version,
|
|
|
|
|
require => Yumrepo[$use_yumrepo],
|
|
|
|
|
require => Yumrepo['openvox'],
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# versionlock puppet-agent before install so the lock exists before any upgrade is attempted
|
|
|
|
|