Hi,
TL;DR - need the "run as administrator" to be automated.
I have tried and tried to get a bat file to run as administrator on a
windows box.
What it is supposed to do is chmod a file in cygwin.
Manually, if i right click and run as administrator, it works fine.
If I run my play (below), it gives no error, but does not do anything (i
run the bat manually, not as admin, and get an error saying permission
denied, so it's def a permissions issue that running as admin solves).
I tried win_ps_exec, but I get an error there saying psexec.exe not found.
What can I do to fix?
- name: copy chmod batch file over
win_copy:
src: /ansible/batch/chmod.bat
dest: C:\TEMP\chmod.bat
- name: copy chmod sh file over
win_copy:
src: /ansible/batch/chmod.sh
dest: C:\TEMP\chmod.sh
- name: Run Batch File
win_command: C:\TEMP\chmod.bat
Contents of bat:
C:\cygwin\bin\mintty.exe C:\TEMP\chmod.sh
Contents of sh:
*chmod* 660 /etc/rsyncd.secrets
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/9c53d45a-c3a0-43f7-8fa2-5c25c3fa7947%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.