roles/vm-*: Move to roles/vm/*
[noc.git] / ansible / roles / vm / grub / tasks / main.yml
diff --git a/ansible/roles/vm/grub/tasks/main.yml b/ansible/roles/vm/grub/tasks/main.yml
new file mode 100644 (file)
index 0000000..f751243
--- /dev/null
@@ -0,0 +1,16 @@
+---
+- name: enable serial console in grub and for kernel
+  with_items:
+    - regexp: '^GRUB_TIMEOUT='
+      line: 'GRUB_TIMEOUT=2'
+    - regexp: '^GRUB_CMDLINE_LINUX='
+      line: 'GRUB_CMDLINE_LINUX="console=ttyS0,115200n8"'
+    - regexp: '^GRUB_TERMINAL='
+      line: 'GRUB_TERMINAL=serial'
+    - regexp: '^GRUB_SERIAL_COMMAND='
+      line: 'GRUB_SERIAL_COMMAND="serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1"'
+  lineinfile:
+    dest: /etc/default/grub
+    regexp: "{{ item.regexp }}"
+    line: "{{ item.line }}"
+  notify: update grub