# raw module inside playbooks

**URL:** <https://forum.ansible.com/t/raw-module-inside-playbooks/18014>\
**Category:** Ansible Project\
**Created:** [April 18, 2015, 2:19pm UTC](https://forum.ansible.com/t/raw-module-inside-playbooks/18014 "2015-04-18T14:19:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Viktor\_Tsymbalyuk](https://avatars.discourse-cdn.com/v4/letter/v/76d3ee/32.png) [@Viktor\_Tsymbalyuk](https://forum.ansible.com/u/Viktor_Tsymbalyuk)\
**Post date:** [April 18, 2015, 2:19pm UTC](https://forum.ansible.com/t/raw-module-inside-playbooks/18014/1 "2015-04-18T14:19:39Z")

</div>

Hi,  
according to module description, raw

> _Executes a low-down and dirty SSH command, not going through the module subsystem._

Everything looks fine using Ad-Hoc Commands.  
But inside playbook

`

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [April 19, 2015, 2:47am UTC](https://forum.ansible.com/t/raw-module-inside-playbooks/18014/2 "2015-04-19T02:47:50Z")

</div>

you might want to add "gather\_facts: False" (between hosts and tasks),  
otherwise the setup module tries to run before the play even gets to  
the raw module

---

<div class="post-metadata">

**Author:** ![Viktor\_Tsymbalyuk](https://avatars.discourse-cdn.com/v4/letter/v/76d3ee/32.png) [@Viktor\_Tsymbalyuk](https://forum.ansible.com/u/Viktor_Tsymbalyuk)\
**Post date:** [April 21, 2015, 10:29am UTC](https://forum.ansible.com/t/raw-module-inside-playbooks/18014/3 "2015-04-21T10:29:32Z")

</div>

Hi, Brian.  
Thank you for explanation, it works.

---

<div class="post-metadata">

**Author:** ![rrrkiran12](https://avatars.discourse-cdn.com/v4/letter/r/41988e/32.png) [@rrrkiran12](https://forum.ansible.com/u/rrrkiran12)\
**Post date:** [April 21, 2015, 10:46am UTC](https://forum.ansible.com/t/raw-module-inside-playbooks/18014/4 "2015-04-21T10:46:00Z")

</div>

Hi,

I have this playbook and getting the same above error

- raw: /home/rccmadm/AIX\_5/nimldr -r -X -D CSCLAB -I 192.168.35.14 -o 48005 -R 10.20.73.128 -U gbevan -S ‘N1ms0ft!’ -l /home/rccmadm/nimldr.log  
when: ansible\_os\_family == “AIX”

If I say gathering facts is false then the condition is ansible\_os\_family check is failing .

How to resolve this ?

---

<div class="post-metadata">

**Author:** ![Toshio\_Kuratomi](https://avatars.discourse-cdn.com/v4/letter/t/41988e/32.png) [@Toshio\_Kuratomi](https://forum.ansible.com/u/Toshio_Kuratomi)\
**Post date:** [April 21, 2015, 1:30pm UTC](https://forum.ansible.com/t/raw-module-inside-playbooks/18014/5 "2015-04-21T13:30:16Z")

</div>

You'll have to make a choice. either install python on the remote  
machine so that fact gathering can work or keep an explicit list of  
hosts that you want to run this task on instead of relying on  
conditionals that need gathered facts.

The fact gathering scripts are written in python so you can't have  
facts without also having a remote python interpreter.

-Toshio
