Shell or Command module hangs and won't finish

187 views
Skip to first unread message

Emil Kacperski

unread,
Jun 8, 2015, 4:34:21 PM6/8/15
to ansible...@googlegroups.com
Hello,

I am trying to run a simple bash script and it works fine on the command line.  When I run it using the shell or command module it simply hangs and
never finishes.  Tried to run using the shell or command module, tried to /dev/null, sleep and using timeout.  Nothing seems to work and I am
out of ideas?  

Thanks!

Brian Coca

unread,
Jun 8, 2015, 4:39:03 PM6/8/15
to ansible...@googlegroups.com
the script might not be detaching, have you tried using the script module?
> --
> 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 post to this group, send email to ansible...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/a41d7677-96f7-4017-8348-9c8ac6d91cfe%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
Brian Coca

Emil Kacperski

unread,
Jun 8, 2015, 4:48:44 PM6/8/15
to ansible...@googlegroups.com
The script is being run on the remote machine, script don't think will apply here.

Thanks!

Emil Kacperski

unread,
Jun 8, 2015, 8:01:23 PM6/8/15
to ansible...@googlegroups.com
Another problem is with bringing up a chromium-browser, wrote a little script and it works fine.  But when I run it using the shell module I get the following:

Gtk: cannot open display


Made sure that export DISPLAY=:0 is in the script, also tried to run a task to export, it simply does not work.  Anyone tried to bring up a chrome browser on a remote machine?


Thanks!

Brian Coca

unread,
Jun 8, 2015, 8:45:39 PM6/8/15
to ansible...@googlegroups.com
in ansible use the environment: keyword for that task to set display
> --
> 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 post to this group, send email to ansible...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/1b896615-7d60-47a7-94c7-694d69d6ef6e%40googlegroups.com.

Emil Kacperski

unread,
Jun 17, 2015, 5:58:37 PM6/17/15
to ansible...@googlegroups.com
Ok so I got everything pretty much running.  Had to use environment to set the shell variable and chromium-browser has to be run in async mode.  It seems
that async mode is in seconds, is there a way to specify hours or days?  Or is there a better way to run a command and not close it?

Thanks!
Reply all
Reply to author
Forward
0 new messages