--- - name: Set up grub env vars: variables: - key: GRUB_GFXMODE value: 1920x1080x32 - key: GRUB_CMDLINE_LINUX_DEFAULT value: '"quiet splash"' hosts: localhost connection: local become: false tasks: - name: Set up environment variables become: true ansible.builtin.lineinfile: path: /etc/default/grub regex: ^{{ item.key }}= line: "{{ item.key }}={{ item.value }}" loop: "{{ variables }}" - name: Update grub become: true ansible.builtin.command: cmd: update-grub2 - name: Set default theme become: true ansible.builtin.command: cmd: plymouth-set-default-theme -R moonlight