b4d70d6008
The cobbler master exports cobbler.main.unkin.net as a CNAME whose value is the bare hostname. BIND's legacy zone-file load completes that against $ORIGIN, but dns-updater renders RFC2136 updates with no $ORIGIN, so the bare label becomes root-absolute (ausyd1nxvm2098.) and dead-ends in NXDOMAIN on the k8s authoritative/resolvers. Qualify the target so both publish paths resolve identically.
82 lines
2.6 KiB
Puppet
82 lines
2.6 KiB
Puppet
# profiles::cobbler::config
|
|
class profiles::cobbler::config {
|
|
|
|
include profiles::cobbler::params
|
|
|
|
$default_password_crypted = $profiles::cobbler::params::default_password_crypted
|
|
$httpd_ssl_certificate = $profiles::cobbler::params::httpd_ssl_certificate
|
|
$httpd_ssl_privatekey = $profiles::cobbler::params::httpd_ssl_privatekey
|
|
$pxe_just_once = $profiles::cobbler::params::pxe_just_once
|
|
$is_cobbler_master = $profiles::cobbler::params::is_cobbler_master
|
|
$service_cname = $profiles::cobbler::params::service_cname
|
|
$next_server = $profiles::cobbler::params::next_server
|
|
$server = $profiles::cobbler::params::server
|
|
$cache_enabled = $profiles::cobbler::params::cache_enabled
|
|
|
|
# manage the cobbler settings file
|
|
file { '/etc/cobbler/settings.yaml':
|
|
ensure => 'file',
|
|
content => template('profiles/cobbler/settings.yaml.erb'),
|
|
group => 'apache',
|
|
owner => 'root',
|
|
mode => '0640',
|
|
require => Package['cobbler'],
|
|
notify => Service['cobblerd'],
|
|
}
|
|
|
|
# manage the debmirror config to meet cobbler requirements
|
|
file { '/etc/debmirror.conf':
|
|
ensure => 'file',
|
|
content => template('profiles/cobbler/debmirror.conf.erb'),
|
|
group => 'root',
|
|
owner => 'root',
|
|
mode => '0644',
|
|
require => Package['debmirror'],
|
|
}
|
|
|
|
# manage the httpd ssl configuration
|
|
file { '/etc/httpd/conf.d/ssl.conf':
|
|
ensure => 'file',
|
|
content => template('profiles/cobbler/httpd_ssl.conf.erb'),
|
|
group => 'root',
|
|
owner => 'root',
|
|
mode => '0644',
|
|
require => Package['httpd'],
|
|
notify => Service['httpd'],
|
|
}
|
|
|
|
# fix permissions in /var/lib/cobbler/web.ss
|
|
file {'/var/lib/cobbler/web.ss':
|
|
ensure => 'file',
|
|
group => 'apache',
|
|
owner => 'root',
|
|
mode => '0660',
|
|
require => Package['cobbler'],
|
|
notify => Service['cobblerd'],
|
|
}
|
|
|
|
# manage the main ipxe menu script
|
|
file { '/var/lib/tftpboot/main.ipxe':
|
|
ensure => 'file',
|
|
content => template('profiles/cobbler/main.ipxe.erb'),
|
|
owner => 'root',
|
|
group => 'root',
|
|
mode => '0644',
|
|
require => Package['cobbler'],
|
|
}
|
|
|
|
# export cnames for cobbler
|
|
if $is_cobbler_master {
|
|
profiles::dns::record { "${::facts['networking']['fqdn']}_${service_cname}_CNAME":
|
|
# CNAME target must be a fully-qualified name (trailing dot): dns-updater
|
|
# parses the value with no $ORIGIN, so a bare label becomes root-absolute
|
|
# ("ausyd1nxvm2098.") and dead-ends in NXDOMAIN.
|
|
value => "${::facts['networking']['fqdn']}.",
|
|
type => 'CNAME',
|
|
record => "${service_cname}.",
|
|
zone => $::facts['networking']['domain'],
|
|
order => 10,
|
|
}
|
|
}
|
|
}
|