cf25a20a92
The VM masters classify through the cobbler ENC while the k8s compilers already use encapi. Install the client ahead of that cutover; external_nodes still points at cobbler-enc, so classification is unchanged. - pin the encapic package to 0.2.0 via profiles::packages::include - add profiles::puppet::encapic managing /etc/encapic/encapic.conf from a hiera-driven ENCAPI_URL, ordered after Package['encapic'] so the config is written once the RPM that owns the path is installed - include the class from profiles::puppet::puppetmaster Requires encapic 0.2.0 in the rpm-internal repo. Reviewed-on: #525 Co-authored-by: unkin-agent <unkin-agent@unkin.net> Co-committed-by: unkin-agent <unkin-agent@unkin.net>
33 lines
1.0 KiB
Puppet
33 lines
1.0 KiB
Puppet
# Class: profiles::puppet::encapic
|
|
#
|
|
# Manages the configuration for the encapic ENC client. The package itself is
|
|
# installed through profiles::packages (pinned in hiera); this class owns the
|
|
# config so the encapi endpoint can change without repackaging.
|
|
class profiles::puppet::encapic (
|
|
Stdlib::HTTPUrl $encapi_url,
|
|
Stdlib::AbsolutePath $config_dir = '/etc/encapic',
|
|
String $config_name = 'encapic.conf',
|
|
String $owner = 'root',
|
|
String $group = 'root',
|
|
) {
|
|
|
|
# The RPM ships this file as %config(noreplace), so puppet must write it only
|
|
# once the package is present or the install overwrites it.
|
|
file { $config_dir:
|
|
ensure => directory,
|
|
mode => '0755',
|
|
owner => $owner,
|
|
group => $group,
|
|
require => Package['encapic'],
|
|
}
|
|
|
|
file { "${config_dir}/${config_name}":
|
|
ensure => file,
|
|
mode => '0644',
|
|
owner => $owner,
|
|
group => $group,
|
|
content => "ENCAPI_URL=${encapi_url}\n",
|
|
require => File[$config_dir],
|
|
}
|
|
}
|