When using the Puppet Masterless on Windows it fails when trying to install SQL Server as it needs administrative privileges. I always thought that cmd commands would execute in an elevated command prompt? Is this not the case? At least on Windows, installations for a good amount of tools do require administrative rights and this would prohibit that.
The work around for now is to execute Puppet from a elevated powershell script.
You're right -- we allow the user to toggle whether or not to use sudo on unix systems, but we don't have anything similar built into the puppet provisioner for running in windows with elevated permissions. I'm glad you have a workaround.
I'd welcome a PR fixing this; a good solution will probably have to involve abstracting away some of the elevated stuff that is currently solely in the powershell provisioner and then using that generalized code for both provisioners so that we don't have hundreds of lines of copypasta to maintain.
I've run into this same issue, trying to refactor some Windows Packer builds to use the built-in puppet-server
provisioner like on Linux instead of maintaining a handful of powershell-based scripts. In my ignorance I forgot that on Windows the Administrator user is not always equivalent to root on Linux.
What what would need to be exposed here? Would something similar to the powershell
provisioner with its "elevated_user": "Administrator"
and "elevated_password": "{{.WinRMPassword}}"
work?
yeah, I think using that same pattern would make sense.
I think github possibly mis-parsed my/a comment and closed this by accident.
This was closed by merging #6972, because there was the keyword fix #5478
.
Edit: re-openning
I'm going to lock this issue because it has been closed for _30 days_ โณ. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Most helpful comment
You're right -- we allow the user to toggle whether or not to use sudo on unix systems, but we don't have anything similar built into the puppet provisioner for running in windows with elevated permissions. I'm glad you have a workaround.
I'd welcome a PR fixing this; a good solution will probably have to involve abstracting away some of the elevated stuff that is currently solely in the powershell provisioner and then using that generalized code for both provisioners so that we don't have hundreds of lines of copypasta to maintain.