salt icon indicating copy to clipboard operation
salt copied to clipboard

pkg.removed and version problems on windows minion.

Open emmellee opened this issue 12 years ago • 6 comments

Issue 4492 was closed about 9 months ago concerning pkg.removed problems on a windows minion; however I am experiencing similar problems. In my standalone windows environment, I cannot specify a version or get "removed" to work within a state.file.

My version is:

C:\salt>salt --versions-report
           Salt: 0.17.2
         Python: 2.7.5 (default, May 15 2013, 22:43:36) [MSC v.1500 32 bit (Inte
l)]
         Jinja2: 2.7.1
       M2Crypto: 0.21.1
 msgpack-python: 0.3.0
   msgpack-pure: Not Installed
       pycrypto: 2.6
         PyYAML: 3.10
          PyZMQ: 13.1.0
            ZMQ: 3.2.2

Each java upgrade is added to the init.sls in the winrepo like so:

javasdk:
  1.7.0.510:
    installer: 'D:\\srv\salt\file_roots\winrepo\javasdk\jdk-7u51-windows-i586.exe'
    full_name: 'Java SE Development Kit 7 Update 51'
    reboot: False
    install_flags: ' /s /v"/norestart AUTOUPDATECHECK=0 JAVAUPDATE=0 JU=0 WEBSTARTICON=0 EULA=0 SYSTRAY=0" '
    msiexec: False
    uninstaller: 'msiexec.exe'
    uninstall_flags: ' /X{32A3A4F4-B792-11D6-A78A-00B0D0170510} /qn'
  1.7.0.250:
    installer: 'D:\\srv\salt\file_roots\winrepo\javasdk\jdk-7u25-windows-i586.exe'
    full_name: 'Java SE Development Kit 7 Update 25'
    reboot: False
    install_flags: ' /s /v"/norestart AUTOUPDATECHECK=0 JAVAUPDATE=0 JU=0 WEBSTARTICON=0 EULA=0 SYSTRAY=0" '
    msiexec: False
    uninstaller: 'msiexec.exe'
    uninstall_flags: ' /X{32A3A4F4-B792-11D6-A78A-00B0D0170250} /qn'

...which allows me to manually remove or install a specific version of the package from the command line like so:

salt-call pkg.remove javasdk version=1.7.0.510

But, I wish to manage the pkg installations and removals via states rather than command line. Unfortunately, I'm unable to successfully install or remove a specific version of the pkg like so:

core-install:
  pkg:
    - installed
    - names:
      - firefox
      - tortoisesvn
      - javasdk: '1.7.0.510'
      - 7zip

core-remove:
  pkg:
    - removed
    - names:
      - javasdk: '1.7.0.250'

The state file is never parsed correctly, but chokes on the use of "removed" and the version number.

emmellee avatar Jan 24 '14 16:01 emmellee

Thanks for the report!

@UtahDave ping

basepi avatar Jan 27 '14 22:01 basepi

I can add to this that I'm having problems too. I'm fairly sure that remove worked for me before but no more. And since remove doesn't work, upgrades of packegs doesn't seem to work either.

Running the following:

root@saltmaster:~# salt 'rs-sm1' pkg.list_pkgs versions_as_list=True
rs-sm1:
    ----------
    7-Zip 9.20 (x64 edition):
        - 9.20.00.0
    Elasticsearch Windows Service:
        - 1.1.1.4
    Microsoft Primary Interoperability Assemblies 2005:
        - 8.0.50727.42
    ReadSoft INVOICES 5-6 Mergemodules:
        - 5.6.10321
    ReadSoft INVOICES 5-6 R1:
        - 5.61.12335
    mRemoteNG:
        - 1.72.5065.32737
    newrelicserveragent:
        - 3.2.6.0
    readsoft-newrelicmetrics:
        - 0.0.0.141
    salt-minion:
        - 2014.1.7
root@saltmaster:~# salt 'rs-sm1' pkg.purge 'readsoft-newrelicmetrics'
rs-sm1:
    ----------
root@saltmaster:~# salt 'rs-sm1' pkg.remove readsoft-newrelicmetrics
rs-sm1:
    ----------

Still leaves my packages there untouched.

Package is defined as:

readsoft-newrelicmetrics:
#[BUILDSERVER_INSERTION_POINT]
  0.0.0.141:
    installer: 'https://mysecretbutitsworking'
    full_name: 'ReadSoft New Relic Metrics'
    reboot: False
    install_flags: '/quiet'
    msiexec: True
    uninstaller: 'https://mysecretbutitsworking' 
    uninstall_flags: '/qn'
  0.0.0.140:
    installer: 'https://mysecretbutitsworking'
    full_name: 'ReadSoft New Relic Metrics'
    reboot: False
    install_flags: '/quiet'
    msiexec: True
    uninstaller: 'https://mysecretbutitsworking' 
    uninstall_flags: '/qn'

Versions report

root@saltmaster:~# salt-run --versions-report
           Salt: 2014.1.7
         Python: 2.7.6 (default, Mar 22 2014, 22:59:56)
         Jinja2: 2.7.2
       M2Crypto: 0.21.1
 msgpack-python: 0.3.0
   msgpack-pure: Not Installed
       pycrypto: 2.6.1
         PyYAML: 3.10
          PyZMQ: 14.0.1
            ZMQ: 4.0.4

andrejohansson avatar Aug 06 '14 07:08 andrejohansson

I found my error...it was a subtle one!

Changing my uninstall flags from:

    uninstall_flags: '/qn'

to

    uninstall_flags: ' /qn '

Made things work. Note the extra spaces before and after "/qn".

andrejohansson avatar Aug 06 '14 07:08 andrejohansson

@emmellee are you still seeing this issue?

UtahDave avatar Aug 06 '14 16:08 UtahDave

sorry, will check this as soon as i return from vacation...


Subject: Re: [salt] pkg.removed and version problems on windows minion. (#9929)

@emmelleehttps://github.com/emmellee are you still seeing this issue?

— Reply to this email directly or view it on GitHubhttps://github.com/saltstack/salt/issues/9929#issuecomment-51356877.

emmellee avatar Aug 11 '14 17:08 emmellee

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.

stale[bot] avatar Dec 04 '17 21:12 stale[bot]