# issue with script module in ansible 2.8

**URL:** <https://forum.ansible.com/t/issue-with-script-module-in-ansible-2-8/31595>\
**Category:** Ansible Project\
**Created:** [November 5, 2019, 11:11am UTC](https://forum.ansible.com/t/issue-with-script-module-in-ansible-2-8/31595 "2019-11-05T11:11:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sandeep\_Sridhar](https://avatars.discourse-cdn.com/v4/letter/s/ba9def/32.png) [@Sandeep\_Sridhar](https://forum.ansible.com/u/Sandeep_Sridhar)\
**Post date:** [November 5, 2019, 11:11am UTC](https://forum.ansible.com/t/issue-with-script-module-in-ansible-2-8/31595/1 "2019-11-05T11:11:34Z")

</div>

I have a shell script that is designed to run “virsh domifaddr | grep ipv4 | awk ‘{print $4}’” on the remote host. From my ansible controller, the playbook calls this piece:

- name: Find out the IP address of ucloud\_vm\_name  
script: /root/mltr\_source\_code/compute\_ucloud\_vm\_ip.sh {{ ucloud\_vm\_name }}

The actual shell script is as follows:

---

<div class="post-metadata">

**Author:** ![Akasurde](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/akasurde/32/230_2.png) [@Akasurde](https://forum.ansible.com/u/Akasurde)\
**Post date:** [November 6, 2019, 4:39am UTC](https://forum.ansible.com/t/issue-with-script-module-in-ansible-2-8/31595/2 "2019-11-06T04:39:43Z")

</div>

Hi Sandeep,

Could you please provide -vvvv log for your playbook run ? Without that information it is very difficult to know what is wrong. I would recommend you to add more debugging statements in shell script before running via Ansible. btw, I see domain name hardcoded at “domifaddr” line (is that expected ?).

Thanks,

---

<div class="post-metadata">

**Author:** ![Akasurde](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/akasurde/32/230_2.png) [@Akasurde](https://forum.ansible.com/u/Akasurde)\
**Post date:** [November 6, 2019, 11:04am UTC](https://forum.ansible.com/t/issue-with-script-module-in-ansible-2-8/31595/3 "2019-11-06T11:04:20Z")

</div>

Hi Sandeep,

Did you get it working ?

---

<div class="post-metadata">

**Author:** ![Sandeep\_Sridhar](https://avatars.discourse-cdn.com/v4/letter/s/ba9def/32.png) [@Sandeep\_Sridhar](https://forum.ansible.com/u/Sandeep_Sridhar)\
**Post date:** [November 6, 2019, 11:06am UTC](https://forum.ansible.com/t/issue-with-script-module-in-ansible-2-8/31595/4 "2019-11-06T11:06:34Z")

</div>

Hi Abhijeet,

Sorry for the delayed response. We can close this thread.

It was not working because, I wasn’t waiting enough for the VM to render an IP address when “virsh domifaddr” was executed.

I just added a sleep 60 in the beginning of the shell script and things went fine after that.

Thank you for your help on this. Really appreciate it.

Greetings,  
Sandeep.
