---
  - name: Install desktop packages
    apt:
      pkg:
        - lubuntu-desktop
        - xorg
        - firefox
        - baobab
        - hardinfo
        - lxappearance
        - xrdp
        - xorgxrdp
      state: latest
      update_cache: yes

  - name: Set default target to graphical
    command: systemctl set-default graphical.target

  - name: root .xsession file
    template: src=xsession dest=/root/.xsession owner=root

  - name: dylan .xsession file
    template: src=xsession dest=/home/dylan/.xsession owner=dylan

  - name: dylan panel.conf file
    template: src=panel.conf dest=/home/dylan/.config/lxqt/panel.conf owner=dylan

  - name: Set new_cursors value to false
    replace:
      path: /etc/xrdp/xrdp.ini
      regexp: '^new_cursors=true'
      replace: 'new_cursors=false'

  - name: Start xrdp
    service: name=xrdp state=started enabled=yes

---
  - name: Install desktop packages
    apt:
      pkg:
        - lubuntu-desktop
        - xorg
        - firefox
        - baobab
        - hardinfo
        - lxappearance
        - xrdp
        - xorgxrdp
      state: latest
      update_cache: yes

  - name: Set default target to graphical
    command: systemctl set-default graphical.target

  - name: root .xsession file
    template: src=xsession dest=/root/.xsession owner=root

  - name: dylan .xsession file
    template: src=xsession dest=/home/dylan/.xsession owner=dylan

  - name: Ensure directory for lxqt config exists
    file: path=/home/dylan/.config/lxqt state=directory owner=dylan

  - name: dylan panel.conf file
    template: src=panel.conf dest=/home/dylan/.config/lxqt/panel.conf owner=dylan

  - name: Set new_cursors value to false
    replace:
      path: /etc/xrdp/xrdp.ini
      regexp: '^new_cursors=true'
      replace: 'new_cursors=false'

  - name: Start xrdp
    service: name=xrdp state=started enabled=yes

Make sure lxqt config dir exists
Make sure lxqt config dir exists