- name: FreePBX - Enable & (Re)start 'freepbx' systemd service (if pbx_enabled)
  systemd:
    daemon_reload: yes
    name: freepbx
    enabled: yes
    state: restarted
  when: pbx_enabled | bool

- name: FreePBX - Disable & Stop 'freepbx' systemd service (if not pbx_enabled)
  systemd:
    daemon_reload: yes
    name: freepbx
    enabled: no
    state: stopped
  when: not pbx_enabled
