- hosts: dev
  name: Install packetfence development packages
  become: True
  gather_facts: False

  collections:
    - debops.debops
    - debops.roles01
    - debops.roles02
    - debops.roles03

  pre_tasks:
    - name: Gather min only
      ansible.builtin.setup:
        gather_subset:
          - "!all"

    # PPA repositories are removed each day and cause issues when refreshing cache
    - name: Clean previous ppa source file if present (Debian)
      file:
        path: '/etc/apt/sources.list.d/packetfence-ppa.list'
        state: absent
      when: ansible_os_family == 'Debian'

    - name: Clean previous ppa source file if present (EL)
      file:
        path: '/etc/yum.repos.d/packetfence-ppa.repo'
        state: absent
      when: ansible_os_family == 'RedHat'

  roles:
    - role: inverse_inc.gitlab_buildpkg_tools
      tags: ci

    - role: apt_preferences
      when: ansible_os_family == 'Debian'
