apt_repository

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

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.

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"
  action: copy src=$item dest=/etc/apt/sources.list.d/ owner=root
group=root mode=0644
  with_fileglob:
    - package_apt/sources.list.d/{{ ansible_lsb.id }}.{{
ansible_lsb.codename }}/*
    - package_apt/sources.list.d/{{ ansible_distribution }}_{{
ansible_distribution_version }}/*
  tags: package_apt
  only_if: $is_os_debian or $is_os_ubuntu
  notify: apt update

- name: "[package_apt] remove /etc/apt/sources.list"
  action: file path=/etc/apt/sources.list state=absent
  tags: package_apt
  only_if: $is_os_debian or $is_os_ubuntu
  notify: apt update

  Peter

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.