Thanks, Jordan.  Ok, I believe I see what you mean.  I only went down this 
convoluted path involving the script and all, because of other problems 
that I ran into.

Changing that playbook to:

---
- hosts: "{{ targets }}"
  user: "{{ admin }}"
  gather_facts: yes

  vars:
    python_exec: /cygdrive/c/Python27/python.exe
    working_dir: /cygdrive/c/t3/run/ae

    sharefile_script: /cygdrive/c/t3/run/ae/tests/sharefile_api_test.py
    confl_script: /cygdrive/c/t3/run/ae/tests/confluence_api_test.py

  tasks:
    - name: Do a test run of Sharefiles and Confluence API scripts...
      raw: "{{ item }}"
      with_items:
        - "{{ sharefile_script }}"
        - "{{ confl_script }}"
      environment:
        ldap_user: "{{ my_ldap_user }}"
        ldap_reg_code: "null"
        ldap_pass: "{{ my_ldap_pass }}"
        gdoc_pass: "{{ my_gdoc_pass }}"
        share_user: "{{ my_sharefiles_user }}"
        share_pass: "{{ my_sharefiles_pass }}"
        wiki_username: "{{ my_ldap_user }}"
        wiki_password: "{{ my_ldap_pass }}"
      ignore_errors: yes
      register: result
    - debug: var=result


I get:

873320-wrk04-ia | FAILED! => {
    "changed": false,
    "failed": true,
    "module_stderr": "Shared connection to 192.168.100.127 closed.\r\n",
    "module_stdout": "C:\\Python27\\python.exe: can't open file 
'/home/agenerette/.ansible/tmp/ansible-tmp-1526330963.81-213142328853085/win_ping.py':
 
[Errno 2] No such file or directory\r\r\n",
    "msg": "MODULE FAILURE"
}


On Monday, May 14, 2018 at 3:54:43 PM UTC-4, Jordan Borean wrote:
>
> I'm a bit confused, do you need to use Cygwin to run this script, 
> everything would be so much simpler if you ignored Cygwin and used 
> something like PowerShell or pure Python? For your current playbook there 
> are a few issues I see;
>
>    - Windows modules, like win_template, do not support the mode/owner 
>    options when it comes to files. Windows uses a more complex setup using 
>    ACLs which don't map neatly with the traditional unix permissions
>    - You are connecting over WinRM (not SSH in cygwin), unix-isms like ~/ 
>    may work but not strictly Windows and may not work in all cases. The path 
>    to ~/ is not necessarily the same path when you are in cygwin, e.g. it's 
>    probably going to be a path in the user directory
>    - The raw module invocation is expecting to be in a cygwin environment 
>    as you are calling a bash script, you are actually in a PowerShell 
>    environment and need to explicitly call C:\cygwin\bin\bash.exe (or 
> wherever 
>    it is located) to execute the bash script in cygwin
>
> What I would do is get rid of the bash script and just execute the Python 
> scripts you have directly in Windows.
>
> Thanks
>
> Jordan
>

-- 
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/7bf3994e-2ec6-4d77-a076-2d975ce3cb53%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to