refine systemd_networkd

This commit is contained in:
2023-08-12 20:19:07 +10:00
parent 24f3a7c485
commit a2ec933cf8
15 changed files with 97 additions and 90 deletions

View File

@ -0,0 +1,5 @@
console_packages:
Archlinux:
- util-linux
console_device: ttyS0

View File

@ -0,0 +1,6 @@
---
- name: Run mkinitcpio
ansible.builtin.command:
cmd: mkinitcpio -p linux
changed_when: true

View 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