---
- hosts: apt
  vars:
    cgrates_branch: master
    distributions:
      - codename: bookworm
        version: 12
      - codename: bullseye
        version: 11

  roles:
    - ../roles/reprepro
    - ../roles/gpg

  tasks:

    # TODO: Execute only when GPG keys have been updated/created
    - name: Resign packages with new GPG key
      become: true
      ansible.builtin.shell: |
        reprepro -Vb {{ reprepro_basedir }} export {{ cgrates_branch }}-{{ item.codename }}
      with_items: "{{ distributions }}"
