serial-console: rework and enable on buildhw-x86

The buildhw-x86 blades also can enable serial console for ipmi/sol.
Rework this to handle the fedora case of options not being in
/etc/grub2-efi.cfg anymore.
Also set both serial S0 and S1 enabled, since some hardware seems to use
one and some uses the other.

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
This commit is contained in:
Kevin Fenzi 2021-12-08 12:48:21 -08:00
parent 274f347097
commit 9fddbf3f3a
2 changed files with 14 additions and 13 deletions

View file

@ -60,7 +60,7 @@
- koji_builder
- { role: bkernel, when: inventory_hostname.startswith('bkernel') }
- { role: clevis, when: "inventory_hostname.startswith(('bkernel', 'buildhw-x86'))" }
- { role: serial-console, when: inventory_hostname.startswith('bkernel') }
- { role: serial-console, when: "inventory_hostname.startswith(('bkernel', 'buildhw-x86'))" }
- hosts
- ipa/client
- { role: sudo, when: not inventory_hostname.startswith('bkernel') }

View file

@ -2,7 +2,7 @@
# This role sets up serial console on ttyS1
#
- name: check for grub serial setup
command: cat /etc/grub2-efi.cfg
command: grub2-editenv list
register: serial
check_mode: no
changed_when: '1 != 1'
@ -11,23 +11,24 @@
- serial-console
- name: set grub to use serial console
command: /sbin/grubby --update-kernel=ALL --args="console=tty0 console=ttyS1,115200"
when: serial is defined and serial.stdout.find("console=tty0 console=ttyS1,115200") == -1
command: /sbin/grubby --update-kernel=ALL --args="console=tty0 console=ttyS0,115200 console=ttyS1,115200"
when: serial is defined and serial.stdout.find("console=tty0 console=ttyS0,115200 console=ttyS1,115200") == -1
failed_when: '1 != 1'
tags:
- serial-console
- name: setup systemd links for getty (S0)
copy: src=serial-getty@.service dest=/etc/systemd/system/serial-getty@ttyS1.service
- name: enable and start getty on both serial ports
systemd:
name: serial-getty@ttyS0
state: started
enabled: true
tags:
- serial-console
- name: link template in
file: dest=/etc/systemd/system/getty.target.wants/serial-getty@ttyS1 src=/etc/systemd/system/serial-getty@ttyS1.service state=link
tags:
- serial-console
- name: start and enable
service: name=serial-getty@ttyS1 enabled=yes state=started
- name: enable and start getty on both serial ports
systemd:
name: serial-getty@ttyS1
state: started
enabled: true
tags:
- serial-console