Skip to content

Commit

Permalink
(#351) code_manager: Switch default to undef
Browse files Browse the repository at this point in the history
  • Loading branch information
bastelfreak committed May 19, 2023
1 parent 0c9528a commit f5e5662
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion plans/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
Optional[Peadm::Ldap_config] $ldap_config = undef,

# Code Manager
Optional[Boolean] $code_manager_auto_configure = true,
Optional[Boolean] $code_manager_auto_configure = undef,
Optional[String] $r10k_remote = undef,
Optional[String] $r10k_private_key_file = undef,
Optional[Peadm::Pem] $r10k_private_key_content = undef,
Expand Down
16 changes: 13 additions & 3 deletions plans/subplans/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
Hash $pe_conf_data = {},

# Code Manager
Optional[Boolean] $code_manager_auto_configure = true,
Optional[Boolean] $code_manager_auto_configure = undef,
Optional[String] $r10k_remote = undef,
Optional[String] $r10k_private_key_file = undef,
Optional[Peadm::Pem] $r10k_private_key_content = undef,
Expand Down Expand Up @@ -125,6 +125,13 @@
# either be undef or else the key content to write.
$r10k_private_key = peadm::file_or_content('r10k_private_key', $r10k_private_key_file, $r10k_private_key_content)

# enable code manager if it isn't explicitly disabled *and* the user provided r10k repo+key
if $r10k_private_key and $code_manager_auto_configure {
$_code_manager_auto_configure = true
} else {
$_code_manager_auto_configure = $code_manager_auto_configure
}

# Same for license key
$license_key = peadm::file_or_content('license_key', $license_key_file, $license_key_content)

Expand Down Expand Up @@ -164,13 +171,16 @@
'puppet_enterprise::puppet_master_host' => $primary_target.peadm::certname(),
'pe_install::puppet_master_dnsaltnames' => $dns_alt_names,
'puppet_enterprise::puppetdb_database_host' => $primary_postgresql_target.peadm::certname(),
'puppet_enterprise::profile::master::code_manager_auto_configure' => $code_manager_auto_configure,
'puppet_enterprise::profile::master::code_manager_auto_configure' => $_code_manager_auto_configure,
'puppet_enterprise::profile::master::r10k_remote' => $r10k_remote,
'puppet_enterprise::profile::master::r10k_private_key' => $r10k_private_key ? {
undef => undef,
default => '/etc/puppetlabs/puppetserver/ssh/id-control_repo.rsa',
},
} + $puppetdb_database_temp_config + $pe_conf_data)
}.delete_undef_values + $puppetdb_database_temp_config + $pe_conf_data)
out::message("########## primary_pe_conf ##########")
out::message($primary_pe_conf)
out::message("########## primary_pe_conf ##########")

$primary_postgresql_pe_conf = peadm::generate_pe_conf({
'console_admin_password' => 'not used',
Expand Down

0 comments on commit f5e5662

Please sign in to comment.