---
- name: Check if /var/packages/debian directory exists
  become: true
  file:
    path: /var/packages/debian
    state: directory

- name: Check if /var/packages/debian/conf directory exists
  become: true
  file:
    path: /var/packages/debian/conf
    state: directory

- name: Check if /var/packages/debian/incoming directory exists
  become: true
  file:
    path: /var/packages/debian/incoming
    state: directory

- name: Add distributions file in reprepro
  become: true
  template:
    src: distributions.conf.j2
    dest: "/var/packages/debian/conf/distributions"
    mode: '0600'
    owner: "{{ rootUser }}"

- name: Add distributions file in reprepro
  become: true
  template:
    src: options.conf.j2
    dest: "/var/packages/debian/conf/options"
    mode: '0600'
    owner: "{{ rootUser }}"

- name: Create override.testing file
  become: true
  copy:
    content: ""
    dest: /var/packages/debian/conf/override.testing
    force: no
    group: root
    owner: root
