|
6 | 6 | function param($name) { inline_template("<%= ENV['PT_${name}'] %>") }
|
7 | 7 |
|
8 | 8 | class configure_node_groups (
|
9 |
| - String[1] $master_host = param('master_host'), |
10 |
| - String[1] $master_replica_host = param('master_replica_host'), |
11 |
| - String[1] $puppetdb_database_host = param('puppetdb_database_host'), |
12 |
| - String[1] $puppetdb_database_replica_host = param('puppetdb_database_replica_host'), |
13 |
| - String[1] $compiler_pool_address = param('compiler_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. |
18 |
| - Enum['true', 'false'] $manage_environment_groups = param('manage_environment_groups'), |
19 |
| -
|
20 |
| - Pattern[/\A[a-z0-9_]+\Z/] $default_environment = 'production', |
21 |
| - Array[Pattern[/\A[a-z0-9_]+\Z/]] $environments = ['production'], |
| 9 | + String[1] $master_host = param('master_host'), |
| 10 | + String[1] $puppetdb_database_host = param('puppetdb_database_host'), |
| 11 | + String[1] $compiler_pool_address = param('compiler_pool_address'), |
| 12 | +
|
| 13 | + Optional[String[1]] $master_replica_host = param('master_replica_host'), |
| 14 | + Optional[String[1]] $puppetdb_database_replica_host = param('puppetdb_database_replica_host'), |
22 | 15 | ) {
|
23 | 16 |
|
24 | 17 | ##################################################
|
@@ -162,53 +155,6 @@ class configure_node_groups (
|
162 | 155 | },
|
163 | 156 | }
|
164 | 157 |
|
165 |
| -
|
166 |
| - if ($manage_environment_groups == 'true') { |
167 |
| -
|
168 |
| - ################################################## |
169 |
| - # ENVIRONMENT GROUPS |
170 |
| - ################################################## |
171 |
| -
|
172 |
| - node_group { 'All Environments': |
173 |
| - ensure => present, |
174 |
| - description => 'Environment group parent and default', |
175 |
| - environment => $default_environment, |
176 |
| - override_environment => true, |
177 |
| - parent => 'All Nodes', |
178 |
| - rule => ['and', ['~', 'name', '.*']], |
179 |
| - } |
180 |
| -
|
181 |
| - node_group { 'Agent-specified environment': |
182 |
| - ensure => present, |
183 |
| - description => 'This environment group exists for unusual testing and development only. Expect it to be empty', |
184 |
| - environment => 'agent-specified', |
185 |
| - override_environment => true, |
186 |
| - parent => 'All Environments', |
187 |
| - rule => [ ], |
188 |
| - } |
189 |
| -
|
190 |
| - $environments.each |$env| { |
191 |
| - $title_env = capitalize($env) |
192 |
| -
|
193 |
| - node_group { "${title_env} environment": |
194 |
| - ensure => present, |
195 |
| - environment => $env, |
196 |
| - override_environment => true, |
197 |
| - parent => 'All Environments', |
198 |
| - rule => ['and', ['=', ['trusted', 'extensions', 'pp_environment'], $env]], |
199 |
| - } |
200 |
| -
|
201 |
| - node_group { "${title_env} one-time run exception": |
202 |
| - ensure => present, |
203 |
| - description => "Allow ${env} nodes to request a different puppet environment for a one-time run", |
204 |
| - environment => 'agent-specified', |
205 |
| - override_environment => true, |
206 |
| - parent => "${title_env} environment", |
207 |
| - rule => ['and', ['~', ['fact', 'agent_specified_environment'], '.+']], |
208 |
| - } |
209 |
| - } |
210 |
| -
|
211 |
| - } |
212 | 158 | }
|
213 | 159 |
|
214 | 160 | include configure_node_groups
|
|
0 commit comments