# Local repo path in tmeplate

**URL:** <https://forum.ansible.com/t/local-repo-path-in-tmeplate/3831>\
**Category:** Get Help\
**Created:** [February 12, 2024, 4:52pm UTC](https://forum.ansible.com/t/local-repo-path-in-tmeplate/3831 "2024-02-12T16:52:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![car](https://avatars.discourse-cdn.com/v4/letter/c/c2a13f/32.png) [@car](https://forum.ansible.com/u/car)\
**Post date:** [February 12, 2024, 4:52pm UTC](https://forum.ansible.com/t/local-repo-path-in-tmeplate/3831/1 "2024-02-12T16:52:15Z")

</div>

Greetings…  
I sparse cloned git into ansible container and like to setup a local repo.

I now need to tell ansible template where my repo is

I tried with just the /tmp/semaphore/repo/ where .git is but this is not working with local repo?

Can any tell my how to write the local repo path?

Thank you.

---

<div class="post-metadata">

**Author:** ![ptn](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/ptn/32/481_2.png) [@ptn](https://forum.ansible.com/u/ptn)\
**Post date:** [February 13, 2024, 7:12pm UTC](https://forum.ansible.com/t/local-repo-path-in-tmeplate/3831/2 "2024-02-13T19:12:28Z")

</div>

Hi,

We need a lot more info here, namely your playbook / tasks and the exact error message and/or behavior which lets you think it’s not working as expected.  
What would “ansible template” be in this context, and what are your trying to achieve ? Also how ?

---

<div class="post-metadata">

**Author:** ![car](https://avatars.discourse-cdn.com/v4/letter/c/c2a13f/32.png) [@car](https://forum.ansible.com/u/car)\
**Post date:** [February 14, 2024, 8:35am UTC](https://forum.ansible.com/t/local-repo-path-in-tmeplate/3831/3 "2024-02-14T08:35:22Z")

</div>

Hi Pierre,

Thank you for your answer.  
Its just a question of how to write the path for a local repo:

So when I setup the repository for our gitlab repo:

ssh://git@our.gitlab.com:222/tech/tech.git it clones into /path/tech and then I points the playbook like /path/tech/path/path/etc/playbook.yml and the playbook works.

I now sparse checkout a part of git and put it here:  
/path/tech/.git

My question is just how would you write the path to a local repo:

/path/tech or /path/tech/.git

and then point /path/tech/path/path/etc/playbook.yml or?

Do you use local repo your self?

Thank you.

---

<div class="post-metadata">

**Author:** ![ptn](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/ptn/32/481_2.png) [@ptn](https://forum.ansible.com/u/ptn)\
**Post date:** [February 14, 2024, 5:25pm UTC](https://forum.ansible.com/t/local-repo-path-in-tmeplate/3831/4 "2024-02-14T17:25:58Z")

</div>

Hi Car,

> Its just a question of how to write the path for a local repo:

It really depends on how and where you plan to use this path; the module you’re using might expect a specific syntax for all I know.  
Apart from that, a clone is a clone, sparse-checkout or not; the only difference being you might specify the items to track in your worktree.

What command or module (+parameters) did you use for your sparse-checkout ?

> and then point /path/tech/path/path/etc/playbook.yml or?

If you decide to track this file in your sparse-checkedout repo, then it should be the same path as for a full clone.

> Do you use local repo your self?

You mean clones in general ? Also what do you mean by ‘use’ ?

Hope it makes sense; if not, please provide more contextual info and I’ll try to complement my answer.

---

<div class="post-metadata">

**Author:** ![car](https://avatars.discourse-cdn.com/v4/letter/c/c2a13f/32.png) [@car](https://forum.ansible.com/u/car)\
**Post date:** [February 16, 2024, 11:58am UTC](https://forum.ansible.com/t/local-repo-path-in-tmeplate/3831/5 "2024-02-16T11:58:11Z")

</div>

Hi Pierre,

I’m setting s up a new root project up in git and go with that.

Thank you for your help.

Carsten Rønne - System Administrator

Alipes Capital ApS

Vimmelskaftet 43, 2 | DK-1161 København K

t: +45 8870 7858 | m: +45 2554 6666

www.alipes.dk

 ![113](https://us1.discourse-cdn.com/ansible/original/2X/0/0327c5efce9831d4d4f10ca80442affb5f363224.jpeg)
