package_services

Enables the services of the selected package groups and adds the regular users to the groups those packages create.

Requirements

  • packages_selected_groups, computed by the playbook's group selection.
  • Privilege escalation (become: true).

Role Variables

VariableDefaultDescription
package_services_by_groupsee belowUnits to enable and start, by OS family and package group.
package_services_device_requirementsbluetooth.service needs hci*Units enabled only when a matching entry exists under path.
package_services_user_groups_by_groupsee belowSystem groups that the users join, by OS family and package group.
package_services_group_usersthe SSH userUsers added to those groups.
package_services_unit_directory/usr/lib/systemd/systemWhere the unit files are looked up.

Default units on Arch Linux:

GroupUnits
01_basebluetooth.service, fstrim.timer, paccache.timer
04_printerscups.socket
12_containers_dockerdocker.socket
20_appsfwupd-refresh.timer

fstrim.timer trims the mounted filesystems once a week. paccache.timer keeps the last three versions of each package in the pacman cache. Debian and Fedora packages usually enable their own services.

Default groups on Arch Linux: realtime with 01_base, for the real-time scheduling limits of realtime-privileges that PipeWire uses, and plugdev with 25_razer, which OpenRazer's udev rule gives the device.

Behavior

A unit whose file is missing is reported instead of enabled. An enabled unit stays enabled. bluetooth.service is skipped, with a message, when the host has no Bluetooth controller (no hci* entry in /sys/class/bluetooth). A group that does not exist yet is reported. Log in again to use a new group.

When the play installs or updates cachyos-ananicy-rules, the role restarts ananicy-cpp so the new rules load.

Dependencies

None.

Example Playbook

- hosts: all
  become: true
  roles:
    - role: package_services
      tags: [package_services]

License

Unlicense

Author Information

pad