-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Ansible provisioner doesn't allow execution of raw powershell commands #4596
Comments
When you run the |
Manually, the command works. It also works when provisioning directly with Ansible (not via Packer).
|
Is the |
The ansible provisioner only supports |
I see that they are the same (as they should be), but my question is about whether or not that user has permission to execute the commands that are failing. |
Yes! |
I see; I'd missed the bootstrap script. Thanks for pointing it out. The |
Yes, the raw module works. The issue is when I try to execute powershell commands via raw. |
I've tried to duplicate this, but am currently running into problems introduced by Ansible 2.3. Can you verify whether this happens with a more common cmdlet (e.g. |
I can duplicate this. From what I can tell, it's because the |
Ansible 2.4 + Packer 1.1.0 + using win_shell instead of raw = works! |
Closing since the issue had a workaround |
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. |
I am having problems executing raw PowerShell commands via Packer's Ansible provisioner.
Example: I can't disable the Windows firewall by running
raw: Set-NetFirewallProfile -Enabled False
, but I can list a directory by runningraw: dir
or set a registry key with Ansible'swin_regedit
module.Here is my full test setup and packer logs:
The text was updated successfully, but these errors were encountered: