Re: [ansible-project] how to set timeout for shell command

2014-09-22 Thread Karl E. Jorgensen
Hi

On Mon, Sep 15, 2014 at 08:36:59AM -0700, Justin Jinsik Kim wrote:
 Hi,
 
 I want to define response waiting time limit for all shell commands on
 ansible-playbook
 
 
 test.yml:
 
 - name: want to quit if it doesn't get response in 5 secs
   shell: sleep 100
 
 - name: want to quit if it doesn't get response in 5 secs
   shell: sleep 200
 
 - name: want to quit if it doesn't get response in 5 secs
   shell: sleep 300
 
 
 
 
 
 I know I can use async method for each task but is there any simple way to do
 this for all shell module command?
 
 I've tried this but it didn't work
 
 ex ansible-playbook test.yml  -T 50
 ex add timeout=10 on ansible.cfg

There is also the shell command timeout (in Debian this is in the
coreutils package, not sure about other distros) - which can enforce a
timeout on a given shell command.

Perhaps that can help too?

-- 
Karl E. Jorgensen

-- 
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-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/20140922085042.GA32240%40hawking.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] how to set timeout for shell command

2014-09-15 Thread Justin Jinsik Kim
Hi,

I want to define response waiting time limit for all shell commands on 
ansible-playbook


test.yml:

- name: want to quit if it doesn't get response in 5 secs
  shell: sleep 100

- name: want to quit if it doesn't get response in 5 secs
  shell: sleep 200

- name: want to quit if it doesn't get response in 5 secs
  shell: sleep 300





I know I can use async method for each task but is there any simple way to 
do this for all shell module command?

I've tried this but it didn't work

ex ansible-playbook test.yml  -T 50
ex add timeout=10 on ansible.cfg


Thanks in advance,
Justin

-- 
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-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/e942c4a7-c017-461d-a99b-956ccf9b5926%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] how to set timeout for shell command

2014-09-15 Thread James Cammarata
Hi Justin, currently there is no general purpose timeout parameter for
shell/commands, so the use of async as you've noted is the proper way to
limit the execution time of a long-running task.

Thanks!

On Mon, Sep 15, 2014 at 10:36 AM, Justin Jinsik Kim neib...@gmail.com
wrote:

 Hi,

 I want to define response waiting time limit for all shell commands on
 ansible-playbook


 test.yml:
 
 - name: want to quit if it doesn't get response in 5 secs
   shell: sleep 100

 - name: want to quit if it doesn't get response in 5 secs
   shell: sleep 200

 - name: want to quit if it doesn't get response in 5 secs
   shell: sleep 300

 



 I know I can use async method for each task but is there any simple way to
 do this for all shell module command?

 I've tried this but it didn't work

 ex ansible-playbook test.yml  -T 50
 ex add timeout=10 on ansible.cfg


 Thanks in advance,
 Justin

  --
 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-project+unsubscr...@googlegroups.com.
 To post to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/e942c4a7-c017-461d-a99b-956ccf9b5926%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/e942c4a7-c017-461d-a99b-956ccf9b5926%40googlegroups.com?utm_medium=emailutm_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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAMFyvFhgb7Zk0aesaZpT3TCt6x08wrFWsfiarcR7Df%3D6DE5KUA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.