ansible 2.9.10
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/root/.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
  python version = 2.7.5 (default, Sep 26 2019, 13:23:47) [GCC 4.8.5 
20150623 (Red Hat 4.8.5-39)]

On Friday, 5 March 2021 at 10:38:07 UTC+10 [email protected] wrote:

> Hi
>
> I've tried adding the following variable directly to the playbook but it' 
> still timing out after 300 seconds. 
>
> The task is running a bash shell script which is copying a file from one 
> folder location to another locally, then sequentially connecting to two 
> remote servers via SSH and copying the file to a file share on each of 
> those servers. 
>
> Despite Ansible reporting the task as failed, the file copy process 
> continues to run to completion in the background.
>
> I need to rectify the 300 second task timeout as I intend to create 
> schedules for these scripts in AWX so require a successful job run 
> outcome.  
>
> Playbook and debug output of ansible-playbook below.
>
> - hosts: all
>   connection: httpapi
>   vars:
>     ansible_command_timeout: 1000
>   tasks:
>     - name: "copy cpviewdb"
>       check_point.mgmt.cp_mgmt_run_script:
>         script_name: "cpviewdb export"
>         script: /usr/tmp/scripts/cpviewdb/cpviewdb_exp_v2.sh
>         targets:
>           - "fw-1"
>        async: 1000
>        poll: 10
>
>
> -------------------------------------------------------------------------------------------------------------------------
>
> task path: /var/lib/awx/projects/checkpoint/cpviewdb_run.yml:7
> <10.1.2.51> ESTABLISH LOCAL CONNECTION FOR USER: root
> <10.1.2.51> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo 
> /root/.ansible/tmp/ansible-local-105715JthvxB `"&& mkdir 
> /root/.ansible/tmp/ansible-local-105715JthvxB/ansible-tmp-1614902298.09-105833-95466278797556
>  
> && echo ansible-tmp-1614902298.09-105833-95466278797556="` echo 
> /root/.ansible/tmp/ansible-local-105715JthvxB/ansible-tmp-1614902298.09-105833-95466278797556
>  
> `" ) && sleep 0'
> Using module file 
> /root/.ansible/collections/ansible_collections/check_point/mgmt/plugins/modules/cp_mgmt_run_script.py
> <10.1.2.51> PUT /root/.ansible/tmp/ansible-local-105715JthvxB/tmpnNzePL TO 
> /root/.ansible/tmp/ansible-local-105715JthvxB/ansible-tmp-1614902298.09-105833-95466278797556/AnsiballZ_cp_mgmt_run_script.py
> <10.1.2.51> EXEC /bin/sh -c 'chmod u+x 
> /root/.ansible/tmp/ansible-local-105715JthvxB/ansible-tmp-1614902298.09-105833-95466278797556/
>  
> /root/.ansible/tmp/ansible-local-105715JthvxB/ansible-tmp-1614902298.09-105833-95466278797556/AnsiballZ_cp_mgmt_run_script.py
>  
> && sleep 0'
> <10.1.2.51> EXEC /bin/sh -c '/usr/bin/python 
> /root/.ansible/tmp/ansible-local-105715JthvxB/ansible-tmp-1614902298.09-105833-95466278797556/AnsiballZ_cp_mgmt_run_script.py
>  
> && sleep 0'
> <10.1.2.51> EXEC /bin/sh -c 'rm -f -r 
> /root/.ansible/tmp/ansible-local-105715JthvxB/ansible-tmp-1614902298.09-105833-95466278797556/
>  
> > /dev/null 2>&1 && sleep 0'
> fatal: [10.1.2.51]: FAILED! => {
>     "changed": false, 
>     "invocation": {
>         "module_args": {
>             "args": null, 
>             "comments": null, 
>             "script": "/usr/tmp/scripts/cpviewdb/cpviewdb_exp_v2.sh", 
>             "script_name": "cpviewdb export", 
>             "targets": [
>                 "fw-1"
>             ], 
>             "version": null, 
>             "wait_for_task": true
>         }
>     }, 
>     "msg": "Task fw-cil-cluster.mgsops.fw - cpviewdb export with task id 
> c2e0722e-a694-47a3-bdb0-6bc842bbd43b failed. Look at the logs for more 
> details"
> }
>
> PLAY RECAP 
> *****************************************************************************************************************************************************************************************************************************
> 10.1.2.51                  : ok=1    changed=0    unreachable=0    
> failed=1    skipped=0    rescued=0    ignored=0   
>
> On Friday, 5 March 2021 at 02:18:40 UTC+10 Brian Coca wrote:
>
>> A generic task `timeout` keyword is added in 2.10.
>>
>> There are 2 other timeouts, first affects connections and it relates to 
>> establishing one and/or reading from one.
>> The other is the ansible_command_timeout variable, which only works for 
>> specific networking modules and it is not 'task wide' but per command 
>> issued within the task.
>>
>> ----------
>> Brian Coca
>>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/592c5a65-9fff-424e-9341-d183c8e37fd6n%40googlegroups.com.

Reply via email to