Skip to content

add parameter for setting final state of infrastructure agents after upgrade #330

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion plans/subplans/configure.pp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
)
}

# Ensure Puppet agent service is running now that configuration is complete
# Configure Puppet agent service status now that configuration is complete
$systemctl_state = $final_agent_state ? {
'running' => 'start',
'stopped' => 'stop'
Expand Down
20 changes: 14 additions & 6 deletions plans/upgrade.pp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
# specified, PEAdm will attempt to download PE installation media from its
# standard public source. When specified, PEAdm will download directly from the
# URL given.
# @param final_agent_state
# Configures the state the puppet agent should be in on infrastructure nodes
# after PE is upgraded successfully.
#
plan peadm::upgrade (
# Standard
Expand All @@ -37,10 +40,11 @@
Optional[String] $internal_compiler_b_pool_address = undef,

# Other
Optional[String] $token_file = undef,
String $stagingdir = '/tmp',
Enum[direct,bolthost] $download_mode = 'bolthost',
Boolean $permit_unsafe_versions = false,
Optional[String] $token_file = undef,
String $stagingdir = '/tmp',
Enum['running', 'stopped'] $final_agent_state = 'running',
Enum[direct,bolthost] $download_mode = 'bolthost',
Boolean $permit_unsafe_versions = false,

Optional[Enum[
'upgrade-primary',
Expand Down Expand Up @@ -349,9 +353,13 @@
}

peadm::plan_step('finalize') || {
# Ensure Puppet running on all infrastructure targets
$service_state = $final_agent_state ? {
'running' => 'start',
'stopped' => 'stop'
}
# Configure Puppet agent service status on all infrastructure targets
run_task('service', $all_targets,
action => 'start',
action => $service_state,
name => 'puppet',
)
}
Expand Down