fix(configuration): enable per-family time-sync and skip sudo-rs lecture

This commit is contained in:
2026-05-31 12:30:26 +02:00
parent 579c499c02
commit 477c8379c4
3 changed files with 39 additions and 36 deletions

View File

@@ -41,6 +41,18 @@
- name: Configure sudo banner - name: Configure sudo banner
when: system_cfg.features.banner.sudo | bool when: system_cfg.features.banner.sudo | bool
block:
- name: Detect the target sudo implementation
ansible.builtin.command: "{{ chroot_command }} /usr/bin/sudo --version"
register: configuration_sudo_version
changed_when: false
failed_when: false
# sudo-rs (Ubuntu 25.10+) implements neither `lecture` nor `lecture_file`
# and warns on every sudo call when they are set. It prints its version banner
# to stderr, not stdout, so match against both streams.
- name: Configure the sudo lecture
when: "'sudo-rs' not in (configuration_sudo_version.stdout ~ configuration_sudo_version.stderr)"
block: block:
- name: Create sudo lecture file - name: Create sudo lecture file
ansible.builtin.copy: ansible.builtin.copy:

View File

@@ -40,9 +40,9 @@
vars: vars:
configuration_systemd_services: >- configuration_systemd_services: >-
{{ {{
['NetworkManager'] ['NetworkManager', _configuration_platform.time_sync_service]
+ ([_configuration_platform.ssh_service] if system_cfg.features.ssh.enabled | bool else []) + ([_configuration_platform.ssh_service] if system_cfg.features.ssh.enabled | bool else [])
+ (['logrotate', 'systemd-timesyncd'] if os == 'archlinux' else []) + (['logrotate'] if os == 'archlinux' else [])
+ (['bluetooth'] if system_cfg.features.desktop.enabled | bool else []) + (['bluetooth'] if system_cfg.features.desktop.enabled | bool else [])
}} }}
ansible.builtin.command: "{{ chroot_command }} systemctl enable {{ item }}" ansible.builtin.command: "{{ chroot_command }} systemctl enable {{ item }}"
@@ -70,14 +70,6 @@
or 'No such file or directory' in (configuration_enable_dm_result.stderr | default('')) or 'No such file or directory' in (configuration_enable_dm_result.stderr | default(''))
or 'does not exist' in (configuration_enable_dm_result.stderr | default('')) or 'does not exist' in (configuration_enable_dm_result.stderr | default(''))
- name: Activate UFW firewall
when:
- system_cfg.features.firewall.backend == 'ufw'
- system_cfg.features.firewall.enabled | bool
ansible.builtin.command: "{{ chroot_command }} ufw --force enable"
register: _ufw_enable_result
changed_when: _ufw_enable_result.rc == 0
failed_when: false
- name: Enable ly on its tty - name: Enable ly on its tty
when: when:
- _configuration_platform.init_system == 'systemd' - _configuration_platform.init_system == 'systemd'

View File

@@ -1,12 +1,11 @@
--- ---
# Platform-specific configuration values keyed by os_family. # Keyed by os_family; tasks read configuration_platform_config[os_family] as _configuration_platform.
# Consumed as _configuration_platform in tasks via:
# configuration_platform_config[os_family]
configuration_platform_config: configuration_platform_config:
RedHat: RedHat:
user_group: wheel user_group: wheel
sudo_group: "%wheel" sudo_group: "%wheel"
ssh_service: sshd ssh_service: sshd
time_sync_service: chronyd
efi_loader: shimx64.efi efi_loader: shimx64.efi
grub_install: false grub_install: false
initramfs_cmd: "/usr/bin/dracut --regenerate-all --force" initramfs_cmd: "/usr/bin/dracut --regenerate-all --force"
@@ -17,6 +16,7 @@ configuration_platform_config:
user_group: sudo user_group: sudo
sudo_group: "%sudo" sudo_group: "%sudo"
ssh_service: ssh ssh_service: ssh
time_sync_service: chrony
efi_loader: grubx64.efi efi_loader: grubx64.efi
grub_install: true grub_install: true
initramfs_cmd: >- initramfs_cmd: >-
@@ -29,6 +29,7 @@ configuration_platform_config:
user_group: wheel user_group: wheel
sudo_group: "%wheel" sudo_group: "%wheel"
ssh_service: sshd ssh_service: sshd
time_sync_service: systemd-timesyncd
efi_loader: grubx64.efi efi_loader: grubx64.efi
grub_install: true grub_install: true
initramfs_cmd: "/usr/sbin/mkinitcpio -P" initramfs_cmd: "/usr/sbin/mkinitcpio -P"
@@ -36,7 +37,6 @@ configuration_platform_config:
locale_gen: true locale_gen: true
init_system: systemd init_system: systemd
# Display manager auto-detection from desktop environment name.
configuration_desktop_dm_map: configuration_desktop_dm_map:
gnome: gdm gnome: gdm
kde: sddm kde: sddm
@@ -48,7 +48,6 @@ configuration_desktop_session_cmd_map:
sway: sway sway: sway
hyprland: Hyprland hyprland: Hyprland
# PipeWire user units enabled globally when a desktop is installed.
# pipewire/pipewire-pulse are socket-activated; wireplumber ships no socket. # pipewire/pipewire-pulse are socket-activated; wireplumber ships no socket.
configuration_desktop_audio_units: configuration_desktop_audio_units:
- pipewire.socket - pipewire.socket