refine systemd_networkd
This commit is contained in:
5
ansible/roles/serial_console/defaults/main.yaml
Normal file
5
ansible/roles/serial_console/defaults/main.yaml
Normal file
@ -0,0 +1,5 @@
|
||||
console_packages:
|
||||
Archlinux:
|
||||
- util-linux
|
||||
|
||||
console_device: ttyS0
|
6
ansible/roles/serial_console/handlers/main.yaml
Normal file
6
ansible/roles/serial_console/handlers/main.yaml
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
|
||||
- name: Run mkinitcpio
|
||||
ansible.builtin.command:
|
||||
cmd: mkinitcpio -p linux
|
||||
changed_when: true
|
27
ansible/roles/serial_console/tasks/main.yaml
Normal file
27
ansible/roles/serial_console/tasks/main.yaml
Normal file
@ -0,0 +1,27 @@
|
||||
---
|
||||
|
||||
# - 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
|
Reference in New Issue
Block a user