I have Ansible playbooks that can transfer files. I have Ansible playbooks that can run small PowerShell scripts. But I cannot get an Ansible playbook to run a long-running PowerShell script. The playbook says it is successful when I run it on the Ansible Linux server. There is no indication of failure. This script installs an .exe. It takes 20 minutes to run. What is the trick to creating a timeout for an Ansible playbook that kicks off a long-duration PowerShell script on a Windows managed node?
To kick off the script, I use the “raw” stanza in the playbook. I tried the command module, but with open source Ansible 1.9, this module was unavailable. I know this PowerShell script works because when I run it manually, everything is fine. I’m not using Kerberos for authentication. The Ansible user that is configured in the inventory file (ansible_ssh_user) is a member of the Administrators group on the Windows 2012 server. The account that I use to successfully start the PowerShell script manually is a local administrator account. I suspect the long duration is the problem. Short duration scripts run fine with Ansible playbooks.