base_role/tasks/Gentoo/systemd.yml

117 lines
3.6 KiB
YAML
Raw Normal View History

2024-01-06 01:38:28 +00:00
# -*- mode: yaml; indent-tabs-mode: nil; tab-width: 2; coding: utf-8-unix -*-
---
- name: "base Gentoo systemd.yml"
debug:
verbosity: 1
msg: "base Gentoo systemd.yml"
# FixMe: Ubuntu too
# https://wiki.gentoo.org/wiki/Systemd
- name: getty@tty{2,3,4,5,6}.service
shell: |
systemctl enable getty@tty{2,3,4,5,6}.service
args:
creates: "/etc/systemd/system/getty.target.wants/getty@tty6.service"
- name: "/etc/systemd/system.conf"
lineinfile:
dest: "/etc/systemd/system.conf"
mode: 0755
owner: "{{BOX_ROOT_USER}}"
group: root
create: yes
regexp: "{{ item.re }}"
line: "{{ item.to }}"
with_items:
- re: "^#*DefaultTimeoutStartSec=.*"
to: "DefaultTimeoutStartSec=180s"
- re: "^#*DefaultIOAccounting=.*"
to: "DefaultIOAccounting=yes"
- name: "/etc/systemd/logind.conf"
lineinfile:
dest: "/etc/systemd/logind.conf"
mode: 0755
owner: "{{BOX_ROOT_USER}}"
group: root
create: yes
regexp: "{{ item.re }}"
line: "{{ item.to }}"
with_items:
- re: "^#*ReserveVT.*"
to: "ReserveVT=1"
- re: "^#*KillUserProcesses.*"
to: "KillUserProcesses=no"
- re: "^#*HandlePowerKey=.*"
to: "HandlePowerKey=ignore"
- re: "^#*HandleSuspendKey=.*"
to: "HandleSuspendKey=ignore"
- re: "^#*HandleHibernateKey=.*"
to: "HandleHibernateKey=ignore"
- re: "^#*HandleLidSwitch=.*"
to: "HandleLidSwitch=ignore"
- re: "^#*HandleLidSwitchExternalPower=.*"
to: "HandleLidSwitchExternalPower=ignore"
- re: "^#*HandleLidSwitchDocked=.*"
to: "HandleLidSwitchDocked=ignore"
- re: "^#*RuntimeDirectorySize=.*"
to: "RuntimeDirectorySize=5%"
- re: "^#*HoldoffTimeoutSec=.*"
to: "HoldoffTimeoutSec=10s"
- re: "^#*IdleAction=.*"
to: "IdleAction=ignore"
- re: "^#*IdleActionSec=.*"
to: "IdleActionSec=360min"
# CONFIG_POWER_SUPPLY_DEBUG option is enabled in the kernel. The current workaround is to disable this option in the kernel, then recompile, install, and boot the new kernel.
- name: "/etc/portage/make.conf base Gentoo/systemd.yml USE"
blockinfile:
dest: /etc/portage/make.conf
create: false
marker: "# {mark} ANSIBLE MANAGED BLOCK base Gentoo/systemd.yml [USE]"
block: |
# USE="elogind -consolekit -systemd" https://forums.gentoo.org/viewtopic-t-1086878-start-0.html
# FixMe: or not udev
USE="${USE} udev -elogind libnotify -consolekit systemd " # -ipv6
- name: "package.use/2020-01_systemd.txt Systemd"
blockinfile:
dest: package.use/2020-01_systemd.txt
create: yes
marker: "# {mark} ANSIBLE MANAGED BLOCK base Gentoo Systemd"
block: |
# The first one doesnt do it - for lvm2
virtual/libudev static-libs
>=virtual/libudev-232 static-libs
sys-fs/udev static-libs
virtual/udev systemd
virtual/libudev systemd
# required by virtual/libudev-232-r3::gentoo[systemd]
# required by sys-fs/lvm2-2.02.186-r2::gentoo
# required by sys-fs/cryptsetup-2.2.2::gentoo
# required by clipos-meta/clipos-sdk-5.0.0_alpha1::clipos
# required by @selected
# required by @world (argument)
sys-apps/systemd static-libs sysv-utils cryptsetup
#https://wiki.gentoo.org/wiki/Systemd
sys-fs/lvm2 -systemd udev
- name: "/etc/portage/package.mask/2019-07_systemd.txt"
blockinfile:
dest: /etc/portage/package.mask/2019-07_systemd.txt
marker: "# {mark} ANSIBLE MANAGED BLOCK base base Gentoo Systemd"
create: yes
block: |
# failsafe - should not be needed
sys-auth/elogind
sys-fs/eudev
#https://wiki.gentoo.org/wiki/Gentoo_Without_systemd
# sys-apps/openrc