salt.states.pkg using * in version causes it to fail everytime
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
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)
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.
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.
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.
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 :-).
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.
very annoying... the correct package(s) are installed, but the state doesn't give itself credit for it and incorrectly reports failure
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.