1
0
IaC/ansible/roles/serial_console/tasks/main.yaml

28 lines
718 B
YAML
Raw Permalink Normal View History

2023-08-10 09:32:17 -04:00
---
# - name: Set serial output for boot loader
- name: Add command line option for mkinitcpio config
when: ansible_distribution == 'Archlinux'
ansible.builtin.copy:
dest: /etc/cmdline.d/console.conf
content: "console={{ console_device }},115200"
owner: root
group: root
mode: '0664'
notify:
- Run mkinitcpio
- name: Install getty provider package (Archlinux)
when: ansible_distribution == 'Archlinux'
community.general.pacman:
name: "{{ console_packages[ansible_os_family] }}"
state: present
update_cache: true
- name: Enable the serial-getty service
ansible.builtin.service:
name: serial-getty@{{ console_device }}.service
enabled: true
state: started