---
- name: Setup server base
  include_role:
    name: "{{ item }}"
  loop:
    - user-administrator
    - user-root
    - sys-svc-sshd
    - sys-svc-journalctl
    - sys-ctl-hlth-disc-space
    - sys-ctl-cln-disc-space
    - sys-ctl-hlth-btrfs
    - sys-ctl-rpr-btrfs-balancer

# It is necessary to setup Matomo first, because all other web apps need it if matomo is activated
- name: setup web-app-matomo
  when: ('web-app-matomo' | application_allowed(group_names, allowed_applications))
  include_role:
    name: web-app-matomo

- name: "Include server roles"
  include_tasks: "./tasks/groups/{{ item }}-roles.yml"
  loop:
    - web-svc   # 1. Load web server services
    - web-app   # 2. Load (UI) web applications
    - util-srv  # 3. Load web server collection roles
    - web-opt   # 4. Load optimation scrips last
  loop_control:
    label: "{{ item }}-roles.yml"
