# Using shell module and referencing the variable in a playbook

**URL:** <https://forum.ansible.com/t/using-shell-module-and-referencing-the-variable-in-a-playbook/18321>\
**Category:** Ansible Project\
**Created:** [May 27, 2015, 6:29pm UTC](https://forum.ansible.com/t/using-shell-module-and-referencing-the-variable-in-a-playbook/18321 "2015-05-27T18:29:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Emil\_Kacperski1](https://avatars.discourse-cdn.com/v4/letter/e/e47c2d/32.png) [@Emil\_Kacperski1](https://forum.ansible.com/u/Emil_Kacperski1)\
**Post date:** [May 27, 2015, 6:29pm UTC](https://forum.ansible.com/t/using-shell-module-and-referencing-the-variable-in-a-playbook/18321/1 "2015-05-27T18:29:18Z")

</div>

I am running a bash script and one of the lines is :

conf\_file= **“xxxxx.conf”**

The config file simply has a variable such as:

screen\_url:[http://www.yahoo.com](http://www.yahoo.com)

The problem is that with multiple machines you would need multiple versions of the script. So the solution is to set the variable or load the config in a playbook.

So I included the following before running the task and shell module:

vars\_files:

- /etc/ansible/url/xxxx.yml

Removed the config file line in the script and ran the playbook. It does not work for some reason, any ideas?

Also when I run the script with a playbook it runs everything fine but it never finishes, I have to ctrl-z and bg.

Guess those are the two questions any help will be gladly appreciated!

Thanks!

Emil
