Skip to content
Snippets Groups Projects
Commit 67a1e7c1 authored by ale's avatar ale
Browse files

Merge branch 'serial-port' into 'master'

float-base: add optional serial port support

See merge request !244
parents fe28f892 86838e19
No related branches found
No related tags found
No related merge requests found
......@@ -42,6 +42,13 @@ motd: |2
╹ ┗━╸┗━┛╹ ╹ ╹ {{ inventory_hostname }}
# Enable kernel lockdown measures (e.g. disable module loading post-boot)
# Once enabled this feature can be disabled only with a reboot.
kernel_lockdown_enabled: false
# When enabled, the kernel GRUB and getty will be using configured to use
# serial port 0 (by default)
enable_serial_port: false
serial_port_unit: 0
serial_port_speed: 115200
......@@ -70,3 +70,5 @@
- name: update-ca-certificates
command: "/usr/sbin/update-ca-certificates"
- name: update-grub
command: /usr/sbin/update-grub
......@@ -83,6 +83,9 @@
- include_tasks: osquery.yml
when: enable_osquery|bool
- include_tasks: serial.yml
when: enable_serial_port|bool
- name: Check ipmi availability
stat:
path: "/dev/ipmi0"
......
# Enable serial output for logins and kernel/GRUB (if running GRUB)
- name: Enable getty on serial port
systemd:
name: "getty@ttyS{{ serial_port_unit }}"
enabled: yes
state: started
- name: Check GRUB availability
stat:
path: "/usr/sbin/update-grub"
register: grub_present
- name: Configure kernel and GRUB to use the serial port
template:
src: grub-serial.j2
dest: /etc/default/grub.d/30-float-serial.cfg
notify:
- update-grub
when: grub_present.stat.exists == true
GRUB_CMDLINE_LINUX="$GRUB_CMDLINE_LINUX console=ttyS{{ serial_port_unit }},{{ serial_port_speed }}n8"
GRUB_TERMINAL="$GRUB_TERMINAL serial"
GRUB_SERIAL_COMMAND="serial --unit={{ serial_port_unit }} --speed={{ serial_port_speed }}"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment