# Ansible access on Gitlab

**URL:** <https://forum.ansible.com/t/ansible-access-on-gitlab/33760>\
**Category:** Ansible Developer\
**Created:** [September 8, 2020, 4:36am UTC](https://forum.ansible.com/t/ansible-access-on-gitlab/33760 "2020-09-08T04:36:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aden\_Fissihaie](https://avatars.discourse-cdn.com/v4/letter/a/e47c2d/32.png) [@Aden\_Fissihaie](https://forum.ansible.com/u/Aden_Fissihaie)\
**Post date:** [September 8, 2020, 4:36am UTC](https://forum.ansible.com/t/ansible-access-on-gitlab/33760/1 "2020-09-08T04:36:46Z")

</div>

Hello all,

I have a lab that is trying to integrate with Ansible and the lab participants need a way to all access Gitlab without having to give each member ssh keys, but rather a service account that allows all users access…is this possible to do?

I am a newbie to Ansible by the way.

I appreciate any input, suggestions or information anyone could provide.

Best,  
Eden

---

<div class="post-metadata">

**Author:** ![Andreas\_Harpfer](https://avatars.discourse-cdn.com/v4/letter/a/6de8d8/32.png) [@Andreas\_Harpfer](https://forum.ansible.com/u/Andreas_Harpfer)\
**Post date:** [September 8, 2020, 8:23am UTC](https://forum.ansible.com/t/ansible-access-on-gitlab/33760/2 "2020-09-08T08:23:12Z")

</div>

Hi, not exactly sure what you are trying to achieve. Gitlab has a  
concept for both a deploy key and a deploy token:

&nbsp;&nbsp;[https://docs.gitlab.com/ee/user/project/deploy\_keys/](https://docs.gitlab.com/ee/user/project/deploy_keys/)  
&nbsp;&nbsp;[https://docs.gitlab.com/ee/user/project/deploy\_tokens/](https://docs.gitlab.com/ee/user/project/deploy_tokens/)

There is not much difference in distributing one or the other to  
your lab participants.

The Ansible `git` module itself shouldn't care:

\* With a deploy key you simply load it into your SSH agent as you  
&nbsp;&nbsp;do with your personal key.

\* With a deploy token, the token is part of the repo URL (see  
&nbsp;&nbsp;usage section of above docs link) and can be filled in e.g.  
&nbsp;&nbsp;from an env variable.

Personally, I prefer a deploy key. (In particular for the technical  
reason that you can't recursively clone Git submodules when using  
a token.)

Hope this helps

Cheers  
-Andi
