diff --git a/roles/common/handlers/main.yml b/roles/common/handlers/main.yml index 144df69..aa48e5f 100644 --- a/roles/common/handlers/main.yml +++ b/roles/common/handlers/main.yml @@ -3,5 +3,8 @@ - name: Restart journald service: name=systemd-journald state=restarted +- name: update-grub + command: update-grub + - name: update-initramfs command: update-initramfs -u -k all diff --git a/roles/common/tasks/Debian.yml b/roles/common/tasks/Debian.yml index 68aa10d..ce2691d 100644 --- a/roles/common/tasks/Debian.yml +++ b/roles/common/tasks/Debian.yml @@ -38,6 +38,15 @@ copy: src=resume dest=/etc/initramfs-tools/conf.d/resume notify: update-initramfs +- name: Enable serial console on KVM VMs + lineinfile: + path: "/etc/default/grub" + state: "present" + regexp: "^#?GRUB_CMDLINE_LINUX=.*" + line: "GRUB_CMDLINE_LINUX=\"console=ttyS0,115200 console=tty0\"" + notify: update-grub + when: ansible_virtualization_role == "guest" and ansible_virtualization_type == "kvm" + - name: Prevent normal users from running su lineinfile: path: /etc/pam.d/su