vm/guest: Provide a root shell on the (virtual) serial console
authornicoo <nicoo@realraum.at>
Wed, 13 Jun 2018 01:51:16 +0000 (03:51 +0200)
committernicoo <nicoo@realraum.at>
Wed, 13 Jun 2018 18:38:40 +0000 (20:38 +0200)
ansible/roles/vm/guest/tasks/main.yml

index 780a276..17c1a53 100644 (file)
   loop_control:
     label: "{{ item.key }}"
   notify: restart rngd
+
+- name: Provide a root shell on the VM console [1/2]
+  file:
+    path: /etc/systemd/system/serial-getty@ttyS0.service.d/
+    state: directory
+
+- name: Provide a root shell on the VM console [2/2]
+  copy:
+    dest: /etc/systemd/system/serial-getty@ttyS0.service.d/autologon.conf
+    content: |
+      [Service]
+      ExecStart=
+      ExecStart=-/sbin/agetty --keep-baud 115200,38400,9600 --noclear --autologin root --login-pause --host {{ vm_install_host }} %I $TERM