---
- name: elogind | Do not run acpid service
  service:
    name: acpid
    enabled: false
    state: stopped

- name: elogind | Manage acpid configuration
  tags: laptop
  block:
    - name: elogind | Create custom config directory for logind.conf
      file:
        path: /etc/elogind/logind.conf.d
        state: directory
        mode: '755'
        owner: root
        group: root

    - name: elogind | Copy logind.conf
      copy:
        src: acpi/logind.conf
        dest: /etc/elogind/logind.conf.d/custom.conf
        mode: '644'
        owner: root
        group: root
