-
Notifications
You must be signed in to change notification settings - Fork 193
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
(PA-2385) Update service management to run always for windows #391
Conversation
Previosly, we only managed services on failure in the powershell script for agent upgrades. Service management for successes were done through the MSI and then through a subsequent puppet run (for pxp-agent service management). This commit updates the script to also manage services in the upgrade script (i.e. actually manage service startup for pxp-agent/puppet in the script rather than relying on puppet to be available). This should alleviate concerns around the initial puppet run failing (and thus leaving pxp-agent off) after upgrades
02fadfb
to
9ee5403
Compare
This commit updates the install_puppet.ps1 script to a file resource rather than a template.
[String] $PuppetMaster='<%= @_puppet_master %>', | ||
[String] $PuppetStartType='<%= @_agent_startup_mode %>', | ||
[String] $InstallArgs='<%= @_install_options %>', | ||
[String] $InstallScriptPIDFile='<%= @_install_pid_file_loc %>', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't in the PS based set of args? Is that on purpose? From reading below, it looks like you removed the need for it, but wanted to double check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, there's no need for this param anymore
# When the MSI installargs parameter is passed to the powershell script it's inside | ||
# a cmd.exe instance, so we need to escape the quotes correctly so they show up as | ||
# plaintext double quotes to the powershell command. (To correctly escape to a | ||
# plaintext " you use three "'s in cmd.exe) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hate cross boundary quoting. A lot.
# The powershell execution uses -Command and not -File because -File will interpolate the quotes | ||
# in a context like cmd.exe: https://docs.microsoft.com/en-us/powershell/scripting/components/console/powershell.exe-command-line-help?view=powershell-6#-file-- | ||
# Because of this it's much cleaner to use -Command and use single quotes for each powershell param | ||
command => "${::system32}\\cmd.exe /S /c start /b ${::system32}\\WindowsPowerShell\\v1.0\\powershell.exe \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our community will truly appreciate your commentary.
No description provided.