Hello Jordan. Yes you are correct. Actually through ansible I already installed IBM liberty server using installer. And here the server.startup. bat file is the default IBM package getting deployed during the liberty server installation. So inorder to start the liberty server, I want to execute that batch file. Usually we are starting it through command line manually by running the batch file.
So here I tried to automate it through ansible playbook and my play was like as given below in this mail chain. I am using server local admin user for winrm connection and installation process. Splitting the batch file will be a difficult task for us as it is a default IBM provided package and I am not well aware of that. Is there anyways to overcome this. I used win_shell, scrit, win_command modules and it's not happening. Please advise me here. I am very new to ansible and apologies for any repeated query. On Wed, 26 Sep 2018, 10:17 Jordan Borean, <[email protected]> wrote: > Running through Ansible is different from running locally because the > tasks are being run under a WinRM logon. Windows treats network (WinRM) and > interactive (local) logons differently and can have different behaviour and > access permissions depending on the type of logon. My recommendations still > stand; > > > - Split the batch file into smaller steps and run each one manually to > see if it breaks > - Add some logging to your batch file to log each step into a file to > verify that is is actually running > - Don't use a batch file and convert to a PowerShell script instead > - Use become on the task to replicate how it would run on an > interactive logon > - Use native PowerShell with Invoke-Command to see if that works, > Ansible uses a similar mechanism to execute tasks > > One thing I am curious about, the batch file is server.startup.bat which > indicates this is trying to startup an executable. Unless you are using > this to startup a scheduled task, service, or a process that is explicitly > defined to breakaway from a job, you will find that once the initial WinRM > process spawned from Ansible is completed, Windows will kill all of it's > child processes. > > If this is the case, you really should be using a proper scheduler like > Windows SCM or Scheduled tasks to run this and not try and spawn it > directly from Ansible. > > 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/f048c37d-b7c8-4091-917b-d884fa957ad2%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-project/f048c37d-b7c8-4091-917b-d884fa957ad2%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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/CAFv5%2Ba1JwGFtqKxO52A0bbOe4VFD-AoCrR_aigY32QHwPAUv%2Bg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
