# playbook hanged due to shell command

**URL:** <https://forum.ansible.com/t/playbook-hanged-due-to-shell-command/29296>\
**Category:** Ansible Developer\
**Created:** [December 19, 2018, 7:52am UTC](https://forum.ansible.com/t/playbook-hanged-due-to-shell-command/29296 "2018-12-19T07:52:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Roeland\_Jansen](https://avatars.discourse-cdn.com/v4/letter/r/54ee81/32.png) [@Roeland\_Jansen](https://forum.ansible.com/u/Roeland_Jansen)\
**Post date:** [December 19, 2018, 7:52am UTC](https://forum.ansible.com/t/playbook-hanged-due-to-shell-command/29296/1 "2018-12-19T07:52:23Z")

</div>

I am pretty new to ansible. I looked at docs and such but it was not too clear for me yet.

at some point in a playbook, the following sequence was executed via the shell module in some yaml file:

scl enable rh-git29 bash

At that moment the playbook stops dead in it’s tracks as the remote end executes a shell and never comes back. It hangs.  
If this observation is true, I don’t understand why it could work in the first place.  
Is this conclusion true?

Secondly, as the only thing the command does is sourcing in a file (needed for the rest of the playbook?)  
I changed it into:

source /opt/rh/rh-git29/enable

I know that the vars are not retained between playbooks this way and is not needed. But is it retained  
within the playbook run itself?

E.g. all folow-up still see the environment set? And does that also hold for any task that’s included?

(like: - include\_tasks: create-something.yml)

Roeland

---

<div class="post-metadata">

**Author:** ![Roeland\_Jansen](https://avatars.discourse-cdn.com/v4/letter/r/54ee81/32.png) [@Roeland\_Jansen](https://forum.ansible.com/u/Roeland_Jansen)\
**Post date:** [December 19, 2018, 8:12am UTC](https://forum.ansible.com/t/playbook-hanged-due-to-shell-command/29296/2 "2018-12-19T08:12:08Z")

</div>

I saw that setting the env for the whole book should be done with parts of something like:

```auto
environment:
  PATH: "{{ ansible_env.PATH }}:/thingy/bin"
  SOME: value

```

```auto
(e.g. the source I did probably has no effect at all)

```

```auto
so I assume that I've answered one of the questions myself.

```

```auto

```
