Handle the MSI installer starting the salt-minion

It's not supposed to start the salt-minion when
START_MINION="" is passed
This commit is contained in:
Twangboy 2023-02-17 10:08:32 -07:00 committed by Pedro Algarvio
parent 0c91f8bb1c
commit 5d31b7e824
2 changed files with 9 additions and 6 deletions

View file

@ -553,6 +553,8 @@ class SaltPkgInstall:
elif pkg.endswith("msi"):
# Install the package
log.debug("Installing: %s", str(pkg))
# START_MINION="" does not work as documented. The service is
# still starting. We need to fix this for RC2
ret = self.proc.run(
"msiexec.exe", "/qn", "/i", str(pkg), 'START_MINION=""'
)
@ -560,6 +562,13 @@ class SaltPkgInstall:
else:
log.error("Invalid package: %s", pkg)
return False
# Stop the service installed by the installer. We only need this
# until we fix the issue where the MSI installer is starting the
# salt-minion service when it shouldn't
log.debug("Removing installed salt-minion service")
self.proc.run(str(self.ssm_bin), "stop", "salt-minion")
# Remove the service installed by the installer
log.debug("Removing installed salt-minion service")
self.proc.run(str(self.ssm_bin), "remove", "salt-minion", "confirm")

View file

@ -1053,12 +1053,6 @@ class VM:
if ret.returncode != 0:
self.ctx.exit(ret.returncode, ret.stderr.strip())
# Maybe this will fix the issue with the MSI not installing
cmd = ["icacls", remote_path, "/grant", "Administrator:(OI)(CI)F", "/T"]
ret = self.run(cmd, capture=True, check=False)
if ret.returncode != 0:
self.ctx.exit(ret.returncode, ret.stderr.strip())
def write_and_upload_dot_env(self, env: dict[str, str]):
if not env:
return