# add the perfact repository to sources.list.d

- name: fix name of perfact-repository for debian
  tags: perfact-repo
  set_fact:
    # example code to overwrite the repo name for one distribution
    # perfact_repo_name: "{{ 'bullseye' if ansible_distribution_release == 'bookworm' else ansible_distribution_release }}"
    perfact_repo_name: "{{ ansible_distribution_release }}"


- name: add perfact-repository
  become: true
  tags: perfact-repo
  ansible.builtin.copy:
    content: |
      deb     https://ubuntu.perfact.de/perfact-packages/{{ perfact_repo_name }} {{ perfact_repo_name }} main
      deb-src https://ubuntu.perfact.de/perfact-packages/{{ perfact_repo_name }} {{ perfact_repo_name }} main
    dest: /etc/apt/sources.list.d/perfact-packages.list
  notify: update perfact-repo

# run handler immediately:
- meta: flush_handlers
