Need to use raw module to enter bash shell but leads to a timeout

8 views
Skip to first unread message

Eren Karaaslan

unread,
Jul 16, 2019, 7:48:24 PM7/16/19
to Ansible Development
I have a remote machine which I ssh to and this leads to a command shell from which I need to enter the command "shell" to enter into the bash shell. I have tried to use the raw module to execute the command and it works, however after entering the bash shell, the rest of my playbook is not preformed. Instead what occurs is that ansible stays in the bash shell for 10 minutes and then times out returning to the original shell. Then, ansible attempts to preform the rest of my playbook, which results in a failure as I need to execute these commands in the bash shell. Essentially, my question is how can I get my ansible playbook to pipe its tasks to be preformed while in the bash shell after I enter the shell using the raw module. Is there another way in which I can enter the bash shell directly using ansible or alternate methods to pipe in the playbook tasks?

Kosala Atapattu

unread,
Jul 16, 2019, 8:12:10 PM7/16/19
to Eren Karaaslan, Ansible Development
Have you tried the shell module?

from the raw module doc:

  • This is useful and should only be done in a few cases. A common case is installing python on a system without python installed by default. Another is speaking to any devices such as routers that do not have any Python installed. In any other case, using the shell or command module is much more appropriate.

On Wed, Jul 17, 2019 at 11:48 AM Eren Karaaslan <erenka...@gmail.com> wrote:
I have a remote machine which I ssh to and this leads to a command shell from which I need to enter the command "shell" to enter into the bash shell. I have tried to use the raw module to execute the command and it works, however after entering the bash shell, the rest of my playbook is not preformed. Instead what occurs is that ansible stays in the bash shell for 10 minutes and then times out returning to the original shell. Then, ansible attempts to preform the rest of my playbook, which results in a failure as I need to execute these commands in the bash shell. Essentially, my question is how can I get my ansible playbook to pipe its tasks to be preformed while in the bash shell after I enter the shell using the raw module. Is there another way in which I can enter the bash shell directly using ansible or alternate methods to pipe in the playbook tasks?

--
You received this message because you are subscribed to the Google Groups "Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-deve...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-devel/0303f12b-c953-4b8e-bc2d-ee2e1091fd64%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
   
Kosala (Ko) Atapattu Technical Account Manager, NZ
+64 27 545 8680 kosala....@actifio.com actifio.com 
Access your enterprise data as a service, instantly anywhere.




Eren Karaaslan

unread,
Jul 17, 2019, 2:00:16 PM7/17/19
to Ansible Development
Unfortunately, this does not work because Python is not installed on the initial shell from which I try to enter the bash shell and thus I cannot use any ansible modules except for raw and script


On Tuesday, July 16, 2019 at 5:12:10 PM UTC-7, Kosala Atapattu wrote:
Have you tried the shell module?

from the raw module doc:

  • This is useful and should only be done in a few cases. A common case is installing python on a system without python installed by default. Another is speaking to any devices such as routers that do not have any Python installed. In any other case, using the shell or command module is much more appropriate.

On Wed, Jul 17, 2019 at 11:48 AM Eren Karaaslan <erenka...@gmail.com> wrote:
I have a remote machine which I ssh to and this leads to a command shell from which I need to enter the command "shell" to enter into the bash shell. I have tried to use the raw module to execute the command and it works, however after entering the bash shell, the rest of my playbook is not preformed. Instead what occurs is that ansible stays in the bash shell for 10 minutes and then times out returning to the original shell. Then, ansible attempts to preform the rest of my playbook, which results in a failure as I need to execute these commands in the bash shell. Essentially, my question is how can I get my ansible playbook to pipe its tasks to be preformed while in the bash shell after I enter the shell using the raw module. Is there another way in which I can enter the bash shell directly using ansible or alternate methods to pipe in the playbook tasks?

--
You received this message because you are subscribed to the Google Groups "Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansibl...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages