[BUG] On Archlinux state pkg.installed
invokes with -S -y -u
causing Salt to fully upgrade a system to install one package introducing quirks in the live system.
#65200
Labels
Description
As per title a simple
pkg.installed
state call causes salt to do a fullpacman -S -y -u
which upgrades all packages on a system when that isn't remotely what were requested.If a kernel upgrade occurs as a result of the above, and the past few years it often does - a live system becomes half broken as it's unable to load any new kernel modules until either:
This doesn't sound like a huge deal at first but the lack of a
/lib/modules/a.b.c-arch1-1
kernel module directory for the currently running kernel breaks many things on the live system where previously-unloaded modules must be probed such as mounting new filesystems, tweaking firewall rules and many more driver situations become inattainable until one of the above steps are taken.This can be avoided with
- refresh: False
to all relevant saltpkg.installed
states or with a jinjagrains.filter_by
block to catch a"default": True, "Arch": False
filter block against theos
grain - though both these workarounds are extremely inconvenient and untidy looking for 329+pkg.installed
matches across our salt states - and would not automatically cover new pkg.installed instances without some kind of messy jinja macro - the kind of thing anybody would accidentally forget to use.(The pkg.install module does not experience this issue :
salt host pkg.install somePkg
only invoking-S
as expected.)Setup
Saltmaster and minion both on Archlinux - packaged install. Though issue lies in state behaviour not setup.
Please be as specific as possible and give set-up details.
Steps to Reproduce the behavior
This should trigger the behaviour:
pkgtest.sls
salt archHost state.sls pkgtest
cat /var/log/pacman.log
# To see the usage ofpacman -S -y -u
by this state.Expected behavior
The salt state to do a
pacman -S --noprogressbar --noconfrim --needed somePkg
alike the behaviour seen in modulepkg.install somePkg
which does so without -y (Sync) or -u (Upgrade)Screenshots
If applicable, add screenshots to help explain your problem.
NA but have
/var/log/pacman.log
output for each call:salt state
pkg.installed
with missing package to resolve:[DateHere] [PACMAN] Running '/usr/bin/pacman -S -y -u --noprogressbar --noconfirm --needed somePkg'
salt above state file with
pkg.installed
but withRefresh: False
in the state:[DateHere] [PACMAN] Running '/usr/bin/pacman -S --noprogressbar --noconfirm --needed somePkg'
Running module
pkg.intsall somePkg
[DateHere] [PACMAN] Running '/usr/bin/pacman -S --noprogressbar --noconfirm --needed somePkg'
Versions Report
salt --versions-report
(Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: