Skip to content

Commit bda5def

Browse files
committed
(MODULES-10653) Failed to upgrade agent using puppet task
Before this commit, when trying to run the `puppet_agent::install_powershell` task, with a specific version as parameter, it was failing with below error message: Error: Timed out waiting for status response from <node_name> On the node, both `puppet agent` and `pxp-agent` services got stopped and the event log viewer showed: Application or service 'task_wrapper' could not be shut down. Due to Windows agents becoming unresponsive when running this task and as per MODULES-10633 discussions, the `puppet_agent::install_poweshell` task should not be used for upgrading Puppet Agents. This Puppet Agent module task will now stop immediately and output a message if the Puppet Agent is already installed on the node.
1 parent b83c5b9 commit bda5def

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

tasks/install_powershell.ps1

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ function Test-PuppetInstalled {
3434
}
3535
}
3636

37+
if (Test-PuppetInstalled) {
38+
Write-Error "Puppet Agent is already installed on this node. Nothing to do."
39+
}
40+
3741
if ($version) {
3842
if ($version -eq "latest") {
3943
$msi_name = "puppet-agent-${arch}-latest.msi"
@@ -42,11 +46,6 @@ if ($version) {
4246
}
4347
}
4448
else {
45-
if (Test-PuppetInstalled) {
46-
Write-Output "Puppet Agent detected and no version specified. Nothing to do."
47-
Exit
48-
}
49-
5049
$msi_name = "puppet-agent-${arch}-latest.msi"
5150
}
5251

0 commit comments

Comments
 (0)