---
- name: Install guest agent
  ansible.builtin.apt:
    name: qemu-guest-agent
  when: ansible_virtualization_role|default(false) == 'guest'
  tags:
    - questagent

- name: Serial Console
  ansible.builtin.lineinfile:
    path: /etc/default/grub
    regexp: ^GRUB_CMDLINE_LINUX_DEFAULT
    line: 'GRUB_CMDLINE_LINUX_DEFAULT="quiet console=ttyS0,115200n1 console=tty0"'
  notify:
    - update grub
    - reboot
  tags:
    - questagent