---
- name: (Amazon Linux/CentOS/Debian/RedHat/Ubuntu) Install NGINX Unit modules
  package:
    name: "{{ item }}"
    state: present
  loop: "{{ nginx_unit_modules }}"
  when: ansible_facts['os_family'] != "FreeBSD"
  notify: (Handler - Amazon Linux/CentOS/Debian/RedHat/Ubuntu) Start NGINX Unit

- name: (FreeBSD) Install NGINX Unit modules
  portinstall:
    name: "{{ item }}"
    state: present
  loop: "{{ nginx_unit_modules }}"
  when: ansible_facts['os_family'] == "FreeBSD"
  notify: (Handler - FreeBSD) Start NGINX Unit