Skip to content

fix(install): install polkitd on Trixie+ manage-network path; minimize apt updates - #3060

Merged
vpetersson merged 3 commits into
masterfrom
fix/network-polkit-armbian-trixie
Jun 11, 2026
Merged

fix(install): install polkitd on Trixie+ manage-network path; minimize apt updates#3060
vpetersson merged 3 commits into
masterfrom
fix/network-polkit-armbian-trixie

Conversation

@vpetersson

@vpetersson vpetersson commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Issues Fixed

No tracked issue. Found while bootstrapping a fresh Rock Pi 4 (Armbian 26.8.0 trixie, kernel 6.18) with the installer's "manage network" option enabled: the install aborted at

TASK [network : Create polkit rules for NetworkManager (Trixie+)]
fatal: msg: "Destination directory /etc/polkit-1/rules.d does not exist"

Description

1. polkitd missing on minimal Trixie (the bug). NetworkManager only Recommends polkitd, so a minimal Trixie image (e.g. Armbian on a Rock Pi / Orange Pi) can ship NetworkManager without polkit installed at all. The Trixie+ branch of the network role writes /etc/polkit-1/rules.d/50-network-manager.rules with ansible.builtin.copy, which does not create parent directories — and with no polkit there is neither that directory nor a daemon to enforce the rule. This adds an explicit polkitd install on the Trixie+ manage-network path, ahead of the rules copy. Scope: only manage_network + Debian major >= 13; the <= 12 (Pi OS Bookworm) path is unchanged.

2. Minimize apt-get update runs (follow-on cleanup). Audited the host install flow so it refreshes the apt lists only when needed — one base update, plus one per added repo:

  • install.sh now routes both its updates through an apt_update_once guard, so a minimal image missing whiptail no longer double-updates; the flag resets only when the legacy apt.screenlyapp.com mirror is actually rewritten (a genuine source change).
  • Dropped redundant update_cache: true on the libc6-dev reinstall and on the new polkitd task — the cache is already fresh by the time those run.
  • The Docker repo install keeps its update_cache: true — that is the legitimate post-repo-add refresh.

Checklist

  • I have performed a self-review of my own code.
  • New and existing unit tests pass locally and on CI with my changes.
  • I have done an end-to-end test for Raspberry Pi devices.
  • I have tested my changes for x86 devices.
  • I added a documentation for the changes I have made (when necessary).

End-to-end validated on a Rock Pi 4 (generic arm64 device type) running Armbian 26.8.0 trixie: with the polkitd fix the full installer completes and all four containers (anthias-server, anthias-viewer, anthias-celery, redis) come up, web UI returns HTTP 200. Not separately run on Pi-OS/x86 — those don't reach the Trixie+ polkit code path (Pi OS Bookworm uses the <= 12 pkla branch). The apt-update changes are no-ops behaviorally (same packages installed, fewer redundant list refreshes).

🤖 Generated with Claude Code

- NetworkManager only Recommends polkitd, so minimal Armbian Trixie
  images ship NM without it and have no /etc/polkit-1/rules.d
- the rules copy task then failed: "Destination directory
  /etc/polkit-1/rules.d does not exist", aborting the install
- install polkitd explicitly so the rule has a home and a daemon to
  enforce it

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@vpetersson
vpetersson requested a review from a team as a code owner June 11, 2026 09:14
@vpetersson vpetersson self-assigned this Jun 11, 2026
@vpetersson
vpetersson requested a review from Copilot June 11, 2026 09:15

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes the Debian 13 (Trixie)+ “manage network” installer path by ensuring polkitd is installed before writing the NetworkManager polkit rule, preventing failures when /etc/polkit-1/rules.d is missing on minimal images.

Changes:

  • Install polkitd when manage_network is enabled on Debian major version >= 13.
  • Keep the existing Trixie+ polkit rule creation step, now guaranteed to have its destination directory provided by the package.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ansible/roles/network/tasks/main.yml Outdated
vpetersson and others added 2 commits June 11, 2026 09:17
- the network role runs after the system role's apt update + dist
  upgrade, so the cache is already fresh
- matches the splashscreen role's mid-playbook package installs, which
  carry no update_cache

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
- guard install.sh's two apt-get updates behind apt_update_once so a
  minimal image no longer double-updates; reset only when the legacy
  Raspbian mirror is actually rewritten
- drop redundant update_cache on the libc6-dev reinstall; the cache is
  already fresh from install.sh
- net result: one base update + one per added repo (Docker)

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@vpetersson vpetersson changed the title fix(ansible): install polkitd on Trixie+ manage-network path fix(install): install polkitd on Trixie+ manage-network path; minimize apt updates Jun 11, 2026
@sonarqubecloud

Copy link
Copy Markdown

@vpetersson
vpetersson merged commit 9094a20 into master Jun 11, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants