--- - name: install lightdm default config when: ws_base_lightdm_defaults is defined copy: dest: /etc/lightdm/lightdm.conf.d/defaults.conf content: | [Seat:*] {% for option, value in ws_base_lightdm_defaults.items() %} {{ option }}={{ value }} {% endfor %} notify: restart lightdm - name: remove lightdm default config when: ws_base_lightdm_defaults is not defined file: path: /etc/lightdm/lightdm.conf.d/defaults.conf state: absent notify: restart lightdm - name: install xrandr setup script when: ws_base_xrandr_setup_script is defined block: - name: install xrandr setup script copy: dest: /usr/local/bin/xrandr-setup.sh content: "{{ ws_base_xrandr_setup_script }}" mode: 0755 - name: install xrandr setup script copy: dest: /etc/lightdm/lightdm.conf.d/xrandr-setup.conf content: | [Seat:*] greeter-setup-script=/usr/local/bin/xrandr-setup.sh session-setup-script=/usr/local/bin/xrandr-setup.sh notify: restart lightdm - name: remove xrandr setup script config when: ws_base_xrandr_setup_script is not defined file: path: /etc/lightdm/lightdm.conf.d/xrandr-setup.conf state: absent notify: restart lightdm