mirror of
https://pagure.io/fedora-infra/ansible.git
synced 2026-05-01 05:51:56 +08:00
Replaces references to shell: with ansible.builtin.shell Signed-off-by: Ryan Lerch <rlerch@redhat.com>
38 lines
985 B
YAML
38 lines
985 B
YAML
#
|
|
# This role sets up serial console on ttyS1
|
|
#
|
|
---
|
|
- name: Check for grub serial setup
|
|
ansible.builtin.shell: grep options /boot/loader/entries/*
|
|
register: serial
|
|
check_mode: no
|
|
changed_when: '1 != 1'
|
|
failed_when: '1 != 1'
|
|
tags:
|
|
- serial-console
|
|
|
|
- name: Set grub to use serial console
|
|
ansible.builtin.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: Enable and start getty on both serial ports
|
|
systemd:
|
|
name: serial-getty@ttyS0
|
|
state: started
|
|
enabled: true
|
|
when: ansible_architecture == 'x86_64'
|
|
tags:
|
|
- serial-console
|
|
|
|
- name: Enable and start getty on both serial ports
|
|
systemd:
|
|
name: serial-getty@ttyS1
|
|
state: started
|
|
enabled: true
|
|
when: ansible_architecture == 'x86_64'
|
|
tags:
|
|
- serial-console
|