|
16 | 16 | # @param ldap_config
|
17 | 17 | # This hash contains the options necessary for configuring the LDAP
|
18 | 18 | # connection on the main server.
|
| 19 | +# @param final_agent_state |
| 20 | +# Configures the state the puppet agent should be in on infrastructure nodes |
| 21 | +# after PE is configured successfully. |
19 | 22 | #
|
20 | 23 | plan peadm::subplans::configure (
|
21 | 24 | # Standard
|
|
30 | 33 | Optional[Peadm::SingleTargetSpec] $replica_postgresql_host = undef,
|
31 | 34 |
|
32 | 35 | # Common Configuration
|
33 |
| - String $compiler_pool_address = $primary_host.peadm::certname(), |
| 36 | + String $compiler_pool_address = $primary_host.peadm::certname(), |
34 | 37 | Optional[String] $internal_compiler_a_pool_address = undef,
|
35 | 38 | Optional[String] $internal_compiler_b_pool_address = undef,
|
36 |
| - Optional[String] $token_file = undef, |
37 |
| - Optional[String] $deploy_environment = undef, |
38 |
| - Optional[Peadm::Ldap_config] $ldap_config = undef, |
| 39 | + Optional[String] $token_file = undef, |
| 40 | + Optional[String] $deploy_environment = undef, |
| 41 | + Optional[Peadm::Ldap_config] $ldap_config = undef, |
39 | 42 |
|
40 | 43 | # Other
|
41 |
| - String $stagingdir = '/tmp', |
| 44 | + String $stagingdir = '/tmp', |
| 45 | + Enum['running', 'stopped'] $final_agent_state = 'running' |
42 | 46 | ) {
|
43 | 47 | # TODO: get and validate PE version
|
44 | 48 |
|
|
147 | 151 | }
|
148 | 152 |
|
149 | 153 | # Ensure Puppet agent service is running now that configuration is complete
|
150 |
| - run_command('systemctl start puppet', peadm::flatten_compact([ |
| 154 | + $systemctl_state = $final_agent_state ? { |
| 155 | + 'running' => 'start', |
| 156 | + 'stopped' => 'stop' |
| 157 | + } |
| 158 | + run_command("systemctl ${systemctl_state} puppet", peadm::flatten_compact([ |
151 | 159 | $primary_target,
|
152 | 160 | $replica_target,
|
153 | 161 | $primary_postgresql_target,
|
|
0 commit comments