-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Description
Description
(Windows)
Sometimes one may want to install a package over itself when it is already installed on the system - specifically meaning the same version of a package.
Reasons for doing this could be to repair a corrupted install or to change a package's configuration.
The current function pkg.install
in the win_pkg
module does not allow for this.
Setup
Have a Salt minion installed on a Windows machine.
The master must be set up for salt-winrepo
or the minion can run masterless.
(Masterless: install Git for Windows then run salt-call winrepo.update_git_repos
- on-prem machine
- VM (Virtualbox, KVM, etc. please specify)
- VM running on a cloud service, please be explicit and add details
- container (Kubernetes, Docker, containerd, etc. please specify)
- or a combination, please be explicit
- jails if it is FreeBSD
- classic packaging
- onedir packaging
- used bootstrap to install
Steps to Reproduce the behavior
(Include debug logs if possible and relevant)
salt-call -l debug pkg.install salt-minion-py3
Output includes the line:
[DEBUG ] pkg.install: 'salt-minion-py3' version '3007.4' is already installed
and then an empty output:
local:
----------
Expected behavior
The minion should at least attempt to install the requested package.
This could be by the addition of a force
parameter, but an alternative could be to
just attempt the install in all cases - as the logic around whether to install a package -
whether an upgrade, downgrade or otherwise should be left to the state module.
Screenshots
If applicable, add screenshots to help explain your problem.
Versions Report
salt --versions-report
(Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)Salt Version:
Salt: 3007.4
Python Version:
Python: 3.10.17 (heads/main:8bbacbe, Jun 9 2025, 20:41:47) [MSC v.1943 64 bit (AMD64)]
Dependency Versions:
cffi: 1.16.0
cherrypy: 18.8.0
cryptography: 42.0.5
dateutil: 2.8.2
docker-py: Not Installed
gitdb: 4.0.10
gitpython: 3.1.43
Jinja2: 3.1.6
libgit2: Not Installed
looseversion: 1.3.0
M2Crypto: Not Installed
Mako: Not Installed
msgpack: 1.0.7
msgpack-pure: Not Installed
mysql-python: Not Installed
packaging: 24.0
pycparser: 2.21
pycrypto: Not Installed
pycryptodome: 3.19.1
pygit2: Not Installed
python-gnupg: 0.5.2
PyYAML: 6.0.1
PyZMQ: 25.1.2
relenv: 0.19.3
smmap: 5.0.1
timelib: 0.3.0
Tornado: 6.4.2
ZMQ: 4.3.4
Salt Package Information:
Package Type: onedir
System Versions:
dist:
locale: utf-8
machine: AMD64
release: 10
system: Windows
version: 10 10.0.26100 SP0 Multiprocessor Free
Additional context
Add any other context about the problem here.