playbook hanged due to shell command

14 views
Skip to first unread message

Roeland Jansen

unread,
Dec 19, 2018, 2:52:23 AM12/19/18
to Ansible Development
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





Roeland Jansen

unread,
Dec 19, 2018, 3:12:23 AM12/19/18
to Ansible Development
I saw that setting the env for the whole book should be done with parts of something like: 

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


(e.g. the source I did probably has no effect at all)
so I assume that I've answered one of the questions myself.


--
You received this message because you are subscribed to a topic in the Google Groups "Ansible Development" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-devel/i1e5wlFiv5g/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ansible-deve...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages