Local repo path in tmeplate

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.

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 ?

1 Like

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.

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.

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

1 Like