Manual VS Ansible playbook in window server

63 views
Skip to first unread message

Manish Kumar

unread,
Oct 9, 2019, 7:49:40 AM10/9/19
to Ansible Project
Dear All,

Below task gets completed while running it manually from  window dos however nothing happens while we execute it using ansible playbook and there is no error as well.

How to debug such issue and get it working ?

Play-book1:
---
- name: install Disribution Server
  gather_facts: false
  hosts: win
 
  tasks:
    - name: Install services
      win_psexec:
       command: D:\Software_InstallationSets\NT_Service_Installset\RepSrv\SETUP.EXE -s -f1D:\Software_InstallationSets\NT_Service_Installset\RepSrv\Repsrv.iss -f2D:\ArisGlobal\Components\RepSrv_Iss.log    

Play-book2:
---
- name: install Disribution Server
  gather_facts: false
  hosts: win
 
  tasks:
    - name: Install services
      win_command: D:\Software_InstallationSets\NT_Service_Installset\RepSrv\SETUP.EXE -s -f1D:\Software_InstallationSets\NT_Service_Installset\RepSrv\Repsrv.iss -f2D:\ArisGlobal\Components\RepSrv_Iss.log  


Output:

Host#  ansible-playbook -i inventory.yml install.yml -vvv

[WARNING] Ansible is in a world writable directory (/U01/automation/playbooks), ignoring it as an ansible.cfg source.

ansible-playbook 2.4.6.0

  config file = /etc/ansible/ansible.cfg

  configured module search path = [u'/home/tsadmin/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']

  ansible python module location = /usr/lib/python2.7/site-packages/ansible

  executable location = /usr/bin/ansible-playbook

  python version = 2.7.16 (default, Jul 19 2019, 23:05:17) [GCC 7.3.1 20180712 (Red Hat 7.3.1-6)]

Using /etc/ansible/ansible.cfg as config file

Parsed /U01/automation/playbooks/inventory.yml inventory source with ini plugin

 

PLAYBOOK: install.yml **********************************************************

1 plays in install.yml

 

PLAY [install Disribution Server] **********************************************

META: ran handlers

 

TASK [Install services] ********************************************************

task path: /U01/automation/playbooks/install.yml:7

Using module file /usr/lib/python2.7/site-packages/ansible/modules/windows/win_psexec.ps1

<192.140.6.17> ESTABLISH WINRM CONNECTION FOR USER: admin on PORT 5986 TO 192.140.6.17

EXEC (via pipeline wrapper)

changed: [192.140.6.17] => {

    "changed": true,

    "delta": "0:00:00.453119",

    "end": "2019-10-09 11:31:36.914910",

    "failed": false,

    "psexec_command": "psexec.exe -accepteula D:\\Software_InstallationSets\\NT_Service_Installset\\RepSrv\\SETUP.EXE -s -f1D:\\Software_InstallationSets\\NT_Service_Installset\\RepSrv\\Repsrv.iss -f2D:\\ArisGlobal\\Components\\RepSrv_Iss.log",

    "rc": 0,

    "start": "2019-10-09 11:31:36.461791",

    "stderr": "D:\\Software_InstallationSets\\NT_Service_Installset\\RepSrv\\SETUP.EXE exited with error code 0.\r\n",

    "stderr_lines": [

        "D:\\Software_InstallationSets\\NT_Service_Installset\\RepSrv\\SETUP.EXE exited with error code 0."

    ],

    "stdout": "\r\nPsExec v2.2 - Execute processes remotely\r\nCopyright (C) 2001-2016 Mark Russinovich\r\nSysinternals - www.sysinternals.com\r\n\r\n",

    "stdout_lines": [

        "",

        "PsExec v2.2 - Execute processes remotely",

        "Copyright (C) 2001-2016 Mark Russinovich",

        "Sysinternals - www.sysinternals.com",

        ""

    ]

}

META: ran handlers

META: ran handlers

 

PLAY RECAP *********************************************************************

192.140.6.17               : ok=1    changed=1    unreachable=0    failed=0



Thanks,

Manish

 

Karl Auer

unread,
Oct 9, 2019, 8:49:12 AM10/9/19
to ansible-project
Is there supposed to be a space after "-f1" or "-f2"? It does look like there should be one, but that's just a wild guess.

Regards, K.


--
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 ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/059d6d3d-3afe-4f33-a5bb-7e52358e0223%40googlegroups.com.


--

Karl Auer { manager, systems support }
P: 1300 759 975
E: ka...@2pisoftware.com
2pisoftware.com

GPG/PGP : 301B 1F4E 624D AD99 242C 7A68 EC24 7113 E854 4A4E
Previous:
958A 2647 6C44 D376 3D63 86A5 FFB2 20BC 0257 5816

Manish Kumar

unread,
Oct 9, 2019, 8:50:41 AM10/9/19
to Ansible Project
yes space is there but in output it is not visible . Also It does not throw any error .
To unsubscribe from this group and stop receiving emails from it, send an email to ansible...@googlegroups.com.

Karl Auer

unread,
Oct 9, 2019, 9:02:18 AM10/9/19
to ansible-project
Dunno about it now throwing an error, but that space is not in the input either, i.e., it is not in the command as you provided it here. And why would it not be in the output? Ansible doesn't randomly remove bits of output. Might be worth double-checking...

Regards, K.


To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/8d5288a4-15f4-4477-a5a9-888f8488ab98%40googlegroups.com.

J Hawkesworth

unread,
Oct 10, 2019, 1:54:19 AM10/10/19
to Ansible Project
Have a read of this...
Is it possible the installer is expecting a GUI?  Sometimes installers have a 'silent' or 'unattended' mode that means they can be made to run without GUI so worth seeing if that is an option.
Running via 'become' instead of via psexec might be worth trying too.

I hope this helps,

Jon

Manish Kumar

unread,
Oct 10, 2019, 4:07:52 AM10/10/19
to Ansible Project
yes it is ignoring  the command passed after -s  . Is there any option to debug and pin point the actual issue as it is working fine without ansible .

Karl Auer

unread,
Oct 10, 2019, 4:14:23 AM10/10/19
to ansible-project
I know NOTHING about Windows, but maybe if you read the doco for the setup.exe program it might have some clues? Also, what output do you get if you replace all the arguments to setup.exe with one "/?"

Regards, K.


To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/fd754dd6-389c-4062-b3cd-2d70ff05af18%40googlegroups.com.

Manish Kumar

unread,
Oct 10, 2019, 5:45:44 AM10/10/19
to Ansible Project
Thanks a lot Jon !!  It worked for me .......
Reply all
Reply to author
Forward
0 new messages