# apt\_repository

**URL:** <https://forum.ansible.com/t/apt-repository/12907>\
**Category:** Ansible Project\
**Tags:** ansible-project\
**Created:** [June 5, 2013, 9:04am UTC](https://forum.ansible.com/t/apt-repository/12907 "2013-06-05T09:04:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hudec\_Peter](https://avatars.discourse-cdn.com/v4/letter/h/a87d85/32.png) [@Hudec\_Peter](https://forum.ansible.com/u/Hudec_Peter)\
**Post date:** [June 5, 2013, 9:04am UTC](https://forum.ansible.com/t/apt-repository/12907/1 "2013-06-05T09:04:28Z")

</div>

Hi Alexander,

At the first sight looks good. I have just revved the code, not tested it.  
The only my requirement is to keep the dependencies to minimal e.g. Python, python-apt (+deps).

I will try to test it…

Peter

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [June 5, 2013, 12:05pm UTC](https://forum.ansible.com/t/apt-repository/12907/2 "2013-06-05T12:05:39Z")

</div>

Right, testing (esp. from those already using this module) is what we want here.

Especially because it rewrites a large chunk of a module some people are already using.

---

<div class="post-metadata">

**Author:** ![Hudec\_Peter](https://avatars.discourse-cdn.com/v4/letter/h/a87d85/32.png) [@Hudec\_Peter](https://forum.ansible.com/u/Hudec_Peter)\
**Post date:** [June 5, 2013, 12:14pm UTC](https://forum.ansible.com/t/apt-repository/12907/3 "2013-06-05T12:14:00Z")

</div>

Anyway, this module is good for fine tunning the repository list based on  
the server role ..

For common role, e.g. The same for all servers, I use another approach ..

- name: "[package\_apt] apt source list files"  
&nbsp;&nbsp;action: copy src=$item dest=/etc/apt/sources.list.d/ owner=root  
group=root mode=0644  
&nbsp;&nbsp;with\_fileglob:  
&nbsp;&nbsp;&nbsp;&nbsp;- package\_apt/sources.list.d/{{ ansible\_lsb.id }}.{{  
ansible\_lsb.codename }}/\*  
&nbsp;&nbsp;&nbsp;&nbsp;- package\_apt/sources.list.d/{{ ansible\_distribution }}\_{{  
ansible\_distribution\_version }}/\*  
&nbsp;&nbsp;tags: package\_apt  
&nbsp;&nbsp;only\_if: $is\_os\_debian or $is\_os\_ubuntu  
&nbsp;&nbsp;notify: apt update

- name: "[package\_apt] remove /etc/apt/sources.list"  
&nbsp;&nbsp;action: file path=/etc/apt/sources.list state=absent  
&nbsp;&nbsp;tags: package\_apt  
&nbsp;&nbsp;only\_if: $is\_os\_debian or $is\_os\_ubuntu  
&nbsp;&nbsp;notify: apt update

&nbsp;&nbsp;Peter

---

<div class="post-metadata">

**Author:** ![Alexander\_Saltanov](https://avatars.discourse-cdn.com/v4/letter/a/5f8ce5/32.png) [@Alexander\_Saltanov](https://forum.ansible.com/u/Alexander_Saltanov)\
**Post date:** [June 5, 2013, 9:45pm UTC](https://forum.ansible.com/t/apt-repository/12907/4 "2013-06-05T21:45:44Z")

</div>

Peter,

Thank you. Please let me know about your testing results.

Alexander.

P.S. I used the same copy-file approach when we managed only one project.
