--- - name: Install XFCE4 desktop environment apt: name: "{{ xfce_packages }}" state: present install_recommends: no vars: xfce_packages: - evince - mousepad - ristretto - xfce4 - xfce4-terminal - xfce4-goodies - xfce4-power-manager - xubuntu-icon-theme - greybird-gtk-theme - pavucontrol - pulseaudio - udisks2 - gvfs - gvfs-backends - gvfs-fuse # for xml module - python3-lxml # TODO: do this the proper way, when it is known how :) - name: HACK overwrite default wallpaper find: paths: /usr/share/backgrounds/xfce patterns: "*" register: xfce_backgrounds - name: HACK overwrite default wallpaper file: path: "{{ item.path }}" state: absent with_items: "{{ xfce_backgrounds.files }}" - name: HACK overwrite default wallpaper file: src: /usr/share/backgrounds/bwlp-1920x1080.png dest: "{{ item.path }}" state: link force: yes with_items: "{{ xfce_backgrounds.files }}" - name: Cleanup applications menu file: path: "{{ item }}" state: absent with_items: - /usr/share/applications/exo-mail-reader.desktop - /usr/share/applications/assistant-qt5.desktop - /usr/share/applications/designer-qt5.desktop - /usr/share/applications/linguist-qt5.desktop - /usr/share/applications/globaltime.desktop - /usr/share/applications/xfcalendar.desktop - name: Copy distro's specific static files copy: src: "files/{{ ansible_distribution_version }}/" dest: / become: yes # disable logout menu items - name: Configure xfce4 logout menu | probe shutdown node xml: path: /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml xpath: /channel/property[@name='shutdown'] count: yes register: shutdown_nodes - name: Configure xfce4 logout menu | check shutdown node debug: var: shutdown_nodes.count - name: Configure xfce4 logout menu | add shutdown node if missing xml: path: /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml xpath: /channel add_children: - property: name: "shutdown" type: "empty" pretty_print: yes when: shutdown_nodes.count == 0 - name: Configure xfce4 logout menu | disable suspend and hibernate xml: path: /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml xpath: /channel/property[@name='shutdown'] add_children: - property: name: "ShowSuspend" type: "bool" value: "false" - property: name: "ShowHibernate" type: "bool" value: "false" pretty_print: yes when: shutdown_nodes.count == 0