Skip to content

Module qubes_dom0_update#38

Merged
marmarek merged 2 commits into
QubesOS:mainfrom
Guiiix:dom0_update
May 20, 2026
Merged

Module qubes_dom0_update#38
marmarek merged 2 commits into
QubesOS:mainfrom
Guiiix:dom0_update

Conversation

@Guiiix

@Guiiix Guiiix commented Apr 29, 2026

Copy link
Copy Markdown
Member

qubesos.core.qubes_dom0_update

This PR adds a new module qubesos.core.qubes_dom0_update to manage packages on dom0.

New features

Ability to install packages on dom0 with the same syntax as common packages managers modules

qubesos.core.qubes_dom0_update:
  state: present
  name: nano

qubesos.core.qubes_dom0_update:
  state: latest
  name: "*"

qubesos.core.qubes_dom0_update:
  state: absent
  name: nano

The generic package module can be used, but the module name must be specified in the use parameter as qubes-dom0-update is not resolved as the package manager by the system facts (maybe we could try to ask to upstream) ?

package:
  state: present
  name: nano
  use: qubesos.core.qubes_dom0_update

The module can be used to switch audio daemon:

qubesos.core.qubes_dom0_update:
  switch_audio_server: pipewire

How it works

state present

For state=present, the module will check in dom0 rpm db if the specified packages are already installed. If so, the module exits without any change. If the specified packages don't exist, it will call qubes-dom0-update to install them. Then, it will look into the local RPM DB a second time to check the version installed and to provide the appropriate output (for example Installed: vim-enhanced-9.1.1914-1.fc41.x86_64)

### state absent

For this state, the module performs exactly the same actions as the dnf5 module: it will use libdnf to check if the packages are installed and remove them.

state latest

To ensure the system (or the specified packages) are up to date, the module will call qubes-dom0-update without any previous analysis. Then it will rely on command output to now if changes happens. If so, it will look into the last RPM transaction to provide the list of upgraded packages.

param switch_audio_daemon

For pipewire, it will check if pipewire and pipewire-pulseaudio are installed. If so, the module exit with changed=false. If not, it will call qubes-dom0-update --switch-audio-daemon pipewire

For pulseaudio, it will check if pulseaudio is installed. If so, the module exit with changed=false. If not, it will call qubes-dom0-update --switch-audio-daemon pipewire

Closes QubesOS/qubes-issues#10266

@codecov-commenter

codecov-commenter commented May 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.72%. Comparing base (e144397) to head (c22ca85).

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #38   +/-   ##
=======================================
  Coverage   83.72%   83.72%           
=======================================
  Files           1        1           
  Lines         215      215           
=======================================
  Hits          180      180           
  Misses         35       35           
Flag Coverage Δ
unittests 83.72% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Guiiix Guiiix changed the title DRAFT - Module qubes_dom0_update Module qubes_dom0_update May 3, 2026
@Guiiix
Guiiix marked this pull request as ready for review May 3, 2026 15:05
Comment thread ansible_collections/qubesos/core/plugins/modules/qubes_dom0_update.py Outdated
Comment thread tests/qubes/test_module_dom0_update_integ.py
@Guiiix
Guiiix requested a review from marmarek May 17, 2026 15:23
@marmarek

Copy link
Copy Markdown
Member

Black complains...

@marmarek

Copy link
Copy Markdown
Member

Except black, this looks okay

Guiiix added 2 commits May 19, 2026 20:33
This new module allows to manage packages on dom0
using qubes-dom0-update and dnf.
@Guiiix

Guiiix commented May 19, 2026

Copy link
Copy Markdown
Member Author

Thanks, should be better now

@marmarek
marmarek merged commit 67cca77 into QubesOS:main May 20, 2026
2 of 3 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.

Qubes-Ansible - Support Qubes-Dom0-Update via Ansible

3 participants