---

- set_fact:
    minifirewall_restart_handler_name: "{{ minifirewall_restart_if_needed | ternary('restart minifirewall', 'restart minifirewall (noop)') }}"

- assert:
    that:
      - evomaintenance_api_endpoint is not none
      - evomaintenance_api_key is not none
    msg: evomaintenance api variables must be set

- include: install_package_debian.yml
  when:
    - not evomaintenance_install_vendor
    - ansible_distribution == "Debian"

- include: install_vendor_debian.yml
  when:
    - evomaintenance_install_vendor
    - ansible_distribution == "Debian"

- include: install_vendor_openbsd.yml
  when:
    - ansible_distribution == "OpenBSD"

- include: minifirewall.yml
  when:
    - evomaintenance_hook_db
    - ansible_distribution == "Debian"
