salt icon indicating copy to clipboard operation
salt copied to clipboard

salt.states.pkg using * in version causes it to fail everytime

Open jessecollier opened this issue 12 years ago • 8 comments

This actually has the desired outcome with the version I want installed, but the state returns false.

My state:

  pkg.installed:
    - name: salt-minion
    - enabled: False
    - version: '2014.1.*'
    - order: 1

Result:

          ID: Install Salt
    Function: pkg.installed
        Name: salt-minion
      Result: False
     Comment: The following packages failed to install/update: salt-minion=2014.1.*.
     Changes:
              ----------
              salt-common:
                  ----------
                  new:
                      2014.1.4+ds-2trusty3
                  old:
                      0.17.5+ds-1
              salt-minion:
                  ----------
                  new:
                      2014.1.4+ds-2trusty3
                  old:
                      0.17.5+ds-1

jessecollier avatar Jun 04 '14 23:06 jessecollier

Right, I don't think we actually support * in the package state. It just happens to work because the target package manager apparently supports that, but when we go back to check to make sure that the version '2014.1.*' was installed, we don't see a matching version (since we're not expanding for globs, we're just doing a direct comparison). We should be able to add support for globbing however.

What version of salt are you using, and on what system? (pkg uses different execution module depending on target system)

basepi avatar Jun 06 '14 17:06 basepi

I'm using Ubuntu 14.04. I install salt-minion as part of my cloud-init process, then salt the box which adds the PPA and installs the version I want. The package ubuntu provides is 0.17.5+ds-1.

jessecollier avatar Jun 06 '14 20:06 jessecollier

Also, I wouldn't mind doing something like '>=2014.1'... but that doesn't seem to work either. What I want to do is specify a minimum version so that I can get bug/security fixes. I'd use pkg.latest, but if 2014.2 comes out, I don't want to install that right away.

jessecollier avatar Jun 06 '14 21:06 jessecollier

I totally understand what you're trying to do, and I think we're going to add support for it, I'm just trying to think of a workaround for the time-being. I suppose you could do pkg.latest, but that's not ideal.

basepi avatar Jun 06 '14 22:06 basepi

Hey, I've run into the same issue. Did you already find a workaround for ensuring a certain minimum version using globs? Would really be helpful :-).

dansoap avatar Jun 27 '14 09:06 dansoap

Well, the installed state will actually run successfully, it just reports failure. So the state currently "works" but you just have to ignore the reported failure, which is less than ideal.

basepi avatar Jun 27 '14 18:06 basepi

very annoying... the correct package(s) are installed, but the state doesn't give itself credit for it and incorrectly reports failure

joshmule avatar Jun 12 '15 16:06 joshmule

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 Nov 18 '17 17:11 stale[bot]