Playbook command on windows machine

40 views
Skip to first unread message

aaron.t...@total.care

unread,
Jun 6, 2016, 11:03:32 AM6/6/16
to Ansible Project
Good morning,
I am running Ansible 2.0 on my Debian host machine.  I have successfully connected to my windows server 2008 m via ping and other types of playbooks.
I am currently attempting to run a playbook that grabs a program off of a shared network folder and installs it on the desired windows machine, but i get:

fatal: [GP1-LAB-OPSTST2]: FAILED! => {"changed": false, "failed": true, "msg": "The given Path (S:\\ClamWin\\clamwin-0.99.1-setup.exe) could not be found", "name": "S:\\ClamWin\\clamwin-0.99.1-setup.exe"}

That is clearly the path.
 
My playbook looks like this:

---    
- name: Install Clamwin
  hosts: WindowsOS
  tasks:
     - name: Install ClamWin
       win_package:
        path="S:\\ClamWin\clamwin-0.99.1-setup.exe"
        product_id="HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\ClamWin Free Antivirus_is1"
        Arguments="/install /passive /norestart"

Any ideas on what i am doing wrong as far as the syntax goes?

Matt Davis

unread,
Jun 6, 2016, 3:03:15 PM6/6/16
to Ansible Project
Just get rid of the quotes and double-backslashes altogether and use standard YAML syntax (instead of Ansible key=value) to get some of the extra parsers out of the way:

- name: Install Clamwin
  hosts: WindowsOS
  tasks:
     - name: Install ClamWin
       win_package:
        path: S:\ClamWin\clamwin-0.99.1-setup.exe
        product_id: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\ClamWin Free Antivirus_is1
        arguments: /install /passive /norestart

Matt Davis

unread,
Jun 6, 2016, 3:04:32 PM6/6/16
to Ansible Project
Drive mapping will also most likely not work- for now, you'll need to use kerberos delegation or use the user/pass args to win_package and direct UNC path.
Reply all
Reply to author
Forward
0 new messages