---
# elogind also handles acpi events
- name: acpi | Configure elogind
  import_tasks: acpi/elogind.yml
  when: seat_manager == 'elogind'

- name: acpi | Configure apci daemon
  when: seat_manager != 'elogind'
  block:
    - name: acpi | Import tasks for the corresponding acpid daemon
      include_tasks: 'acpi/{{ acpid_daemon }}.yml'
      when: acpid_daemon == 'acpid'

    - name: acpi | Enable acpid service on runlevel 'default'
      service:
        name: acpid
        runlevel: default
        enabled: true
        state: started
