# problems with variables: git module creating wrong directory, /root/\\\[/root/olio\\\]/

**URL:** <https://forum.ansible.com/t/problems-with-variables-git-module-creating-wrong-directory-root-root-olio/15056>\
**Category:** Ansible Project\
**Created:** [April 20, 2014, 5:13pm UTC](https://forum.ansible.com/t/problems-with-variables-git-module-creating-wrong-directory-root-root-olio/15056 "2014-04-20T17:13:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel\_Charbonneau](https://avatars.discourse-cdn.com/v4/letter/d/47e85d/32.png) [@Daniel\_Charbonneau](https://forum.ansible.com/u/Daniel_Charbonneau)\
**Post date:** [April 20, 2014, 5:13pm UTC](https://forum.ansible.com/t/problems-with-variables-git-module-creating-wrong-directory-root-root-olio/15056/1 "2014-04-20T17:13:10Z")

</div>

The second task below fails with npm not being able to find a package.json within /root/ That is, it doesn’t know that it should cd into /root/olio, and so of course it isn’t going to find a package.json file.

The git module for some reason creates this directory structure:  
/root/[/root/olio]/

…which seems to imply the variable isn’t interpreted correctly.

I’m also using the root user to login right now because I haven’t yet grasped creating users.

---

<div class="post-metadata">

**Author:** ![Tomasz\_Kontusz](https://avatars.discourse-cdn.com/v4/letter/t/bc79bd/32.png) [@Tomasz\_Kontusz](https://forum.ansible.com/u/Tomasz_Kontusz)\
**Post date:** [April 20, 2014, 7:00pm UTC](https://forum.ansible.com/t/problems-with-variables-git-module-creating-wrong-directory-root-root-olio/15056/2 "2014-04-20T19:00:22Z")

</div>

Daniel Charbonneau \<novo.charbonneau75@gmail.com\> napisał:

> The second task below fails with npm not being able to find a  
> package.json  
> within /root/ That is, it doesn't know that it should cd into  
> /root/olio,  
> and so of course it isn't going to find a package.json file.
> 
> The git module for some reason creates this directory structure:  
> /root/\[/root/olio\]/
> 
> ...which seems to imply the variable isn't interpreted correctly.
> 
> I'm also using the root user to login right now because I haven't yet  
> grasped creating users.
> 
> ---  
> # roles/olio/vars/main.yml
> 
> olio\_directory:  
> - /root/olio

This creates olio\_directory as list with one element. You want just:  
olio\_directory: /root/olio

---

<div class="post-metadata">

**Author:** ![Daniel\_Charbonneau](https://avatars.discourse-cdn.com/v4/letter/d/47e85d/32.png) [@Daniel\_Charbonneau](https://forum.ansible.com/u/Daniel_Charbonneau)\
**Post date:** [April 20, 2014, 8:27pm UTC](https://forum.ansible.com/t/problems-with-variables-git-module-creating-wrong-directory-root-root-olio/15056/3 "2014-04-20T20:27:08Z")

</div>

Thank you Tomasz, that fixed it!
