Closed ruzickap closed 3 years ago
Thanks for the bug report, the Set-Acl
work is done so that msiexec
can access the .msi
file. It seems like msiexec
spawns some system process which runs as SYSTEM
which is why we set the temporary ACE to allow it. We will need to have a check to see if the file system is read-only/allows ACEs or just ignore the error and hope for the best.
Here is a PR that should fix this issue for you https://github.com/ansible-collections/ansible.windows/pull/147.
Thank you for a quick response.
I replaced my win_package.ps1
by your https://github.com/jborean93/ansible.windows/blob/win_package-acl/plugins/modules/win_package.ps1 from the #147 and now I'm getting this error:
qemu: task path: /Users/ruzickap/git/packer-templates/ansible/roles/ansible-role-virtio-win/tasks/virtio-win.yml:79
qemu: Monday 07 December 2020 08:55:57 +0100 (0:00:11.666) 0:02:55.584 *******
qemu: redirecting (type: modules) ansible.builtin.win_package to ansible.windows.win_package
qemu: Using module file /usr/local/Cellar/ansible/2.10.3_1/libexec/lib/python3.9/site-packages/ansible_collections/ansible/windows/plugins/modules/win_package.ps1
qemu: Pipelining is enabled.
qemu: <127.0.0.1> ESTABLISH WINRM CONNECTION FOR USER: vagrant on PORT 4342 TO 127.0.0.1
qemu: EXEC (via pipeline wrapper)
qemu: The full traceback is:
qemu: The term 'None' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
qemu: At line:1 char:1
qemu: + None
qemu: + ~~~~
qemu: + CategoryInfo : ObjectNotFound: (None:String) [], ParentContainsErrorRecordException
qemu: + FullyQualifiedErrorId : CommandNotFoundException
qemu:
qemu: ScriptStackTrace:
qemu: at <ScriptBlock>, <No file>: line 1
qemu: fatal: [127.0.0.1]: FAILED! => {
qemu: "changed": false,
qemu: "msg": "Unhandled exception while executing module: The term 'None' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again."
qemu: }
I'm not sure if I can "easily" replace the win_package.ps1
in Ansible 2.10.3 by the one from the #147, but I just give it a go trying to test it.
Let me know if there is "better" way how I can test the PR.
Thank you
That’s a very weird error message, it would indicate that the module didn’t have the correct contents. There’s nothing special in that PR that makes it incompatible with what comes with 2.10.x.
Thank you... I did the tests again and the PR fixed the issue.
Thanks again... (I hope it will be merged soon)
Just waiting your confirmation :). I’ll merge it tomorrow and am planning on creating a new release sometime next week.
SUMMARY
I'm using the
win_package
to install the qemu-ga-x86_64.msi package the from CD-ROM (read-only) device:Ansible is giving me this error:
(The Ansible code is called from Packer)
The full code can be found here: https://github.com/ruzickap/ansible-role-virtio-win/blob/d918586fa811f4e45a64b386b581d3179cb95828/tasks/virtio-win.yml#L79-L82
This was working fine in Ansible 2.9
It seems like
Set-Acl
from this file https://github.com/ansible-collections/ansible.windows/blob/28ce8268ca0a0fbc6ebfed456efd242ff4799aa3/plugins/modules/win_package.ps1#L421 is trying to do the change on read-only device. But I'm just guessing...ISSUE TYPE
COMPONENT NAME
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
MacOS 10.15.7