Skip to content

Commit 352cb09

Browse files
committed
Clarify manage_environment_node_groups param type
The user experience should be, pass a boolean. Unfortunately there's some ugliness in the shell script due to the boolean being passed via environment variable and coming out the other side as a string ("true" or "false"). For now, until we switch to Bolt apply, we're going to just sequester this ugliness in the shell script and keep the user experience a Boolean type.
1 parent b073bc2 commit 352cb09

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Diff for: plans/configure.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
Boolean $executing_on_primary_master = false,
1414

1515
String[1] $compile_master_pool_address = $primary_master_host,
16-
String[1] $manage_environment_groups = 'true',
16+
Boolean $manage_environment_groups = true,
1717
Optional[String[1]] $deploy_environment = undef,
1818

1919
String[1] $stagingdir = '/tmp',

Diff for: tasks/configure_node_groups.sh

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/bin/bash
22

3+
34
/opt/puppetlabs/bin/puppet apply --environment production <<'EOF'
45
56
function param($name) { inline_template("<%= ENV['PT_${name}'] %>") }
@@ -10,7 +11,12 @@ class configure_node_groups (
1011
String[1] $puppetdb_database_host = param('puppetdb_database_host'),
1112
String[1] $puppetdb_database_replica_host = param('puppetdb_database_replica_host'),
1213
String[1] $compile_master_pool_address = param('compile_master_pool_address'),
14+
15+
# Note: the task accepts a Boolean for manage_environment_groups. Passed in
16+
# as an environment variable, this will be cast to the string "true" or the
17+
# string "false". Thus, the Puppet class type is Enum, rather than Boolean.
1318
Enum['true', 'false'] $manage_environment_groups = param('manage_environment_groups'),
19+
1420
Pattern[/\A[a-z0-9_]+\Z/] $default_environment = 'production',
1521
Array[Pattern[/\A[a-z0-9_]+\Z/]] $environments = ['production'],
1622
) {

0 commit comments

Comments
 (0)