--- - name: Set up env hosts: localhost connection: local become: false tasks: - name: Set up XDG_DATA_DIRS become: true ansible.builtin.lineinfile: path: /etc/environment regex: ^{{ item.key }}= line: '{{ item.key }}={{ item.value }}' with_items: - {key: MOZ_ENABLE_WAYLAND, value: 1} - {key: SAL_USE_VCLPLUGIN, value: gtk3} - {key: TZ, value: Europe/Stockholm} - {key: XDG_DATA_DIRS, value: /usr/local/share/:/usr/share/}