# Stupid Question from a Rookie :)

**URL:** <https://forum.ansible.com/t/stupid-question-from-a-rookie/11836>\
**Category:** Ansible Project\
**Tags:** ansible-project\
**Created:** [August 28, 2012, 1:49pm UTC](https://forum.ansible.com/t/stupid-question-from-a-rookie/11836 "2012-08-28T13:49:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![chris6](https://avatars.discourse-cdn.com/v4/letter/c/b2d939/32.png) [@chris6](https://forum.ansible.com/u/chris6)\
**Post date:** [August 28, 2012, 1:49pm UTC](https://forum.ansible.com/t/stupid-question-from-a-rookie/11836/1 "2012-08-28T13:49:21Z")

</div>

> &nbsp;&nbsp;&nbsp;- name: create folder  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;action: raw mkdir /home/MYPC/${ansible\_hostname}

Maybe try using the file module here instead of raw?

> &nbsp;&nbsp;&nbsp;- name: launch uname -a  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;action: raw /uname -a \> /home/MYPC/${ansible\_hostname}/uname.log

Look at using the command module for this action.

If you want the data from the remote host on the host you are running the playbook from, look at the fetch module as  
a third task.

Do you know this page?  
[http://ansible.github.com/modules.html](http://ansible.github.com/modules.html)

--Chris

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [August 28, 2012, 1:56pm UTC](https://forum.ansible.com/t/stupid-question-from-a-rookie/11836/2 "2012-08-28T13:56:08Z")

</div>

I think I somehow posted and also removed the parent to this message,  
so those reading at googlegroups.com may not see it.

The original question is pasted below.

LuC,

Ansible playbooks do things on remote hosts, not the local machine,  
mixing commands that you execute remotely with local paths all on the  
same line isn't going to make any sense to Ansible.

If you want to log things locally, write or use one of the logger  
callbacks... or just use /usr/bin/ansible with the --tree option,  
which will approximate what you want.

Though if you just want to see all the unames of all your hosts, an  
API script using the setup module may be what you want.

Cc:  
Hello,

hope someone can help me.

I have 20 Servers in my network.

hosts file looks like :  
[XXX1]  
192.168.178.161  
192.168.178.162  
192.168.178.163

i want to collect informations like "uname -a \> uname.log" about these  
20 servers and store them on my local pc where im launching ansible.  
at the same time i want to create folders on my local pc created by  
the ip. So i get 20 directories which have a file called uname.log.

for example my playbooks look like this:  
- hosts: XXX1  
&nbsp;&nbsp;user: XXX2  
# sudo: False

&nbsp;&nbsp;&nbsp;&nbsp;- name: create folder  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;action: raw mkdir /home/MYPC/${ansible\_hostname}

&nbsp;&nbsp;&nbsp;&nbsp;- name: launch uname -a  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;action: raw /uname -a \> /home/MYPC/${ansible\_hostname}/uname.log

My Problem:

1. ansible try to create folders on the far servers. but i want the  
folders local on my pc. then ansible creates folders who called 192

2. i want that ansible store my uname.log also local on my pc

So my Question, what are the Errors, in my Playbook (its just a  
chapter 🙂 ),  
hope some can help me.

Greetz and thanke in advanced

LuC
