- name: Login
  hosts: localhost
  connection: local
  tags:
    - login
  tasks:
    - name: Write SDDM config
      ansible.builtin.template:
        src: 'sddm.conf'
        dest: '/etc/sddm.conf.d/stardeck_settings.conf'
        owner: root
        group: root
        mode: '0644'
  tasks:
    - name: Write logind.conf
      ansible.builtin.copy:
        src: 'logind.conf'
        dest: '/etc/systemd/logind.conf'
        owner: root
        group: root
        mode: '0644'
      notify: Restart logind
  handlers:
    - name: Restart logind
      ansible.builtin.systemd_service:
        name: systemd-logind
        state: restarted
