Skip to content

Commit e08c4b5

Browse files
committed
(#351) code_manager: Switch default to undef
1 parent 97ec11b commit e08c4b5

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

REFERENCE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1690,7 +1690,7 @@ Data type: `Optional[Boolean]`
16901690

16911691

16921692

1693-
Default value: `true`
1693+
Default value: `undef`
16941694

16951695
##### <a name="-peadm--install--r10k_remote"></a>`r10k_remote`
16961696

plans/install.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
Optional[Peadm::Ldap_config] $ldap_config = undef,
5050

5151
# Code Manager
52-
Optional[Boolean] $code_manager_auto_configure = true,
52+
Optional[Boolean] $code_manager_auto_configure = undef,
5353
Optional[String] $r10k_remote = undef,
5454
Optional[String] $r10k_private_key_file = undef,
5555
Optional[Peadm::Pem] $r10k_private_key_content = undef,

plans/subplans/install.pp

+10-3
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
Hash $pe_conf_data = {},
4747

4848
# Code Manager
49-
Optional[Boolean] $code_manager_auto_configure = true,
49+
Optional[Boolean] $code_manager_auto_configure = undef,
5050
Optional[String] $r10k_remote = undef,
5151
Optional[String] $r10k_private_key_file = undef,
5252
Optional[Peadm::Pem] $r10k_private_key_content = undef,
@@ -125,6 +125,13 @@
125125
# either be undef or else the key content to write.
126126
$r10k_private_key = peadm::file_or_content('r10k_private_key', $r10k_private_key_file, $r10k_private_key_content)
127127

128+
# enable code manager if it isn't explicitly disabled *and* the user provided r10k repo+key
129+
if $r10k_private_key and $code_manager_auto_configure {
130+
$_code_manager_auto_configure = true
131+
} else {
132+
$_code_manager_auto_configure = $code_manager_auto_configure
133+
}
134+
128135
# Same for license key
129136
$license_key = peadm::file_or_content('license_key', $license_key_file, $license_key_content)
130137

@@ -164,13 +171,13 @@
164171
'puppet_enterprise::puppet_master_host' => $primary_target.peadm::certname(),
165172
'pe_install::puppet_master_dnsaltnames' => $dns_alt_names,
166173
'puppet_enterprise::puppetdb_database_host' => $primary_postgresql_target.peadm::certname(),
167-
'puppet_enterprise::profile::master::code_manager_auto_configure' => $code_manager_auto_configure,
174+
'puppet_enterprise::profile::master::code_manager_auto_configure' => $_code_manager_auto_configure,
168175
'puppet_enterprise::profile::master::r10k_remote' => $r10k_remote,
169176
'puppet_enterprise::profile::master::r10k_private_key' => $r10k_private_key ? {
170177
undef => undef,
171178
default => '/etc/puppetlabs/puppetserver/ssh/id-control_repo.rsa',
172179
},
173-
} + $puppetdb_database_temp_config + $pe_conf_data)
180+
}.delete_undef_values + $puppetdb_database_temp_config + $pe_conf_data)
174181

175182
$primary_postgresql_pe_conf = peadm::generate_pe_conf({
176183
'console_admin_password' => 'not used',

0 commit comments

Comments
 (0)