---

- name: (extrepo.yml) Install extrepo package
  ansible.builtin.apt:
    name: extrepo
    state: present
  tags:
    - extrepo

- name: (extrepo.yml) Enable contrib policy in /etc/extrepo/config.yaml
  ansible.builtin.lineinfile:
    path: /etc/extrepo/config.yaml
    regexp: '^(#\s*)?-\s*contrib$'
    insertafter: '^- main$'
    line: '- contrib'
  tags:
    - extrepo

- name: (extrepo.yml) Enable non-free policy in /etc/extrepo/config.yaml
  ansible.builtin.lineinfile:
    path: /etc/extrepo/config.yaml
    regexp: '^(#\s*)?-\s*non-free$'
    insertafter: '^- contrib$'
    line: '- non-free'
  tags:
    - extrepo
