New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Windows 3004 move config not working for EXE #15
Comments
I confirm the bug, the pki keys are not moved so the 3004 minion generate a new key and try to authenticate to the master which denied the access for that minion. The strange thing is that when I logging to the windows workstation with the running minion and execute manually the following command:
It's working fine, the pki keys are move to So, to me, the issue only comes when I use:
I'm using salt-minion-py3.sls with the following patch: --- salt-minion-py3.sls.orig 2022-02-07 16:37:12.755547613 +0100
+++ salt-minion-py3.sls 2022-02-07 16:40:42.571193281 +0100
@@ -7,6 +7,13 @@
# 2015.8.2 you will not be able to use pkg.install to upgrade Salt again. You
# will have to upgrade Salt through another means.
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{%- set arch = grains['cpuarch'] %}
+{%- set install_flags_map = {
+ '3004-3': ' /move-config',
+ '3004-2': ' /move-config',
+ '3004': ' /move-config',
+ } %}
+
salt-minion-py3:
{%
for version in [
@@ -20,15 +27,11 @@
%}
'{{ version }}':
full_name: 'Salt Minion {{ version }} (Python 3)'
- {% if grains['cpuarch'] == 'AMD64' %}
- installer: 'https://repo.saltstack.com/windows/Salt-Minion-{{ version }}-Py3-AMD64-Setup.exe'
- {% else %}
- installer: 'https://repo.saltstack.com/windows/Salt-Minion-{{ version }}-Py3-x86-Setup.exe'
- {% endif %}
+ installer: 'https://repo.saltstack.com/windows/Salt-Minion-{{ version }}-Py3-{{ arch }}-Setup.exe'
{% raw %}
# install_flags: "/S /master={{ salt['pillar.get']('salt:master', 'salt.domain.tld') }} /minion-id={{ salt['pillar.get']('salt:minion:ids:' ~ grains['host'] }}"
{% endraw %}
- install_flags: '/S'
+ install_flags: {{ '/S' ~ install_flags_map.get(version, '') }}
uninstaller: 'C:\salt\uninst.exe'
uninstall_flags: '/S'
msiexec: False |
I think it has something to do with the existing running salt process if salt is calling the update itself? We've been rolling the upgrade out with 3004-3 installer using our older, soon to be retired Ansible pipeline and it works great but trying to use the salt-minion-py3 pkg installer still results in the files never being moved. I'm using the above salt-minion-py3 patch @baby-gnu provided with the /move-config parameter. |
@twangboy what is the ETA of a fix for this? All of our new windows minions now have the salt app installed under the new Program Files location, BUT the minion_id and pki files etc ( and presumably the cache too under c:\salt\var but don't care about old cache ,) are still left behind under "c:\salt\conf" |
I'll try to look at this today |
As I'm looking at this... I'm wondering if there's still a process running with a lock on something in that directory when it tries to move it... |
@twangboy From my testing that's more than likely what's going on, it works flawlessly if I use an outside method to do the install but running it from within the salt formula/winpkg is when it fails. |
Description
When running the exe installer from the command line with the /move-config switch, Salt is upgraded, the new registry keys are created but they point to the existing C:\salt locations, root_dir and config_dir are not updated.
The GUI, however, works and will move config if instructed.
Setup
I used the provided state from the salt-winrepo-ng repo and added the /move-config switch
Steps to Reproduce the behavior
A Windows Server 2019 (2012R2 and 2016 also tested) VM running 3003.3 was used to test the above state against which results in Salt being upgrade but the binaries and config are not moved. Moving to running the installer locally without Salt and with the /minion-name and /master switches, alongside /move-config, the same was observed. In both situations, C:\ProgramData\Salt Project\Salt is created, no files are migrated.
When running locally without Salt involved
If I remove all switches C:\ProgramData\Salt Project\Salt is created but the config is not migrated, the registry keys are created and point to C:\salt. If I only specify /move-config then C:\ProgramData\Salt Project\Salt is not created
When attempting to force configuration to remain in C:\salt by using /master /minion-name and /install-dir, the configuration is moved from C:\salt\conf to C:\ProgramData\Salt Project\Salt\conf - including the pki files - but creates new defaults in C:\salt which then causes the minion key to be denied as coming from the same minion_id
Expected behavior
The binaries are expected to be moved to C:\Program Files and config to C:\ProgramData with C:\salt removed
Versions Report
salt --versions-report
Master
Minion
Additional context
This may just be the nature of the MSI installer but I am unable to use this inplace of the EXE in the state provided as it uninstalls Salt and seems to kill the installer in the process so you are left in an uninstalled state.
However, performing an upgrade with the MSI installer, outside of any salt state and provided the installer is not inside C:\salt, works and will move the config using MOVE_CONF.
The text was updated successfully, but these errors were encountered: