salt icon indicating copy to clipboard operation
salt copied to clipboard

pkg.installed says "failed" but still installs when rpm has epoch number

Open jetpak opened this issue 10 years ago • 6 comments

salt master: 2015.8.7 (Beryllium) salt minion: 2015.8.7 (Beryllium)

i am trying to install a 'mongo' RPM that has an epoch number of '1', so the full package version is '1:0.0.1-2'

the following state causes a failure output, but the RPM does get installed:

============= State =========================================================
mongo_install_vers:
  pkg.installed:
    - fromrepo: {{ services_repo }}
    - pkgs:
      - mongo: 0.0.1-2
======================= Failure Output: ========================================
local:
----------
          ID: mongo_install_vers
    Function: pkg.installed
      Result: False
     Comment: The following packages failed to install/update: mongo=0.0.1-2
     Started: 03:13:30.507343
    Duration: 7585.238 ms
     Changes:
              ----------
              mongo:
                  ----------
                  new:
                      1:0.0.1-2
                  old:

Summary for local
------------
Succeeded: 0 (changed=1)
Failed:    1
------------
Total states run:     1
========================== YUM Output =======================================
[root@ip-10-1-164-132 centos]# yum list installed | grep mongo
mongo.x86_64                     1:0.0.1-2                   @symphony_services
python-pymongo.x86_64            2.5.2-4.el7                 @epel
========================== RPM Output =======================================
[root@ip-10-1-164-132 centos]# rpm -qa --queryformat '%{NAME}_|-%{EPOCH}_|-%{VERSION}_|-%{RELEASE}_|-%{ARCH}_|-(none)\n' | grep mongo
python-pymongo_|-(none)_|-2.5.2_|-4.el7_|-x86_64_|-(none)
mongo_|-1_|-0.0.1_|-2_|-x86_64_|-(none)
========================== Salt Minion Log (Debug Level) ==========================
016-02-23 03:13:31,667 [salt.loaded.int.module.cmdmod][INFO    ][27498] Executing command 'yum -y --disablerepo=\'*\' --enablerepo=\'symphony_services\'    install "mongo-0.0.1-2"' in directory '/root'
2016-02-23 03:13:37,603 [salt.loaded.int.module.cmdmod][INFO    ][27498] Executing command ['rpm', '-qa', '--queryformat', '%{NAME}_|-%{EPOCH}_|-%{VERSION}_|-%{RELEASE}_|-%{ARCH}_|-(none)\n'] in directory '/root'
2016-02-23 03:13:38,036 [salt.utils.lazy  ][DEBUG   ][27498] Could not LazyLoad pkg.version_clean
2016-02-23 03:13:38,037 [salt.state       ][ERROR   ][27498] Made the following changes:
'mongo' changed from 'absent' to '1:0.0.1-2'

jetpak avatar Feb 23 '16 03:02 jetpak

there has been a few times in recent salt releases, where new EC2 instances would get new versions of salt-minion that would regress or break our salt states but our existing minions have no problems

what is the best way to setup my salt-cloud profile so that we can lock in a specific (older) version of salt-minion to be installed?

jetpak avatar Feb 23 '16 03:02 jetpak

i have tried adding the "script_args" in the salt-cloud profiles, but:

  1. git v2015.5.5 does install correctly, but i'd rather install a yum rpm

  2. stable 2015.5 seems to be what i want, however it doesn't seem to work on centos7

  3. is there any other way to get bootstrap-salt.sh / deploy.sh to install the 'salt-minion-2015.5.*' rpm from repo.saltstack.com/yum/rhel7 repo? or, do i have to resort to hacking deploy.sh?

jetpak avatar Feb 23 '16 08:02 jetpak

btw, the error when i use "stable 2015.5" as the "script_args" is:

  • ERROR: CentOS does not have major version pegged packages support

jetpak avatar Feb 23 '16 08:02 jetpak

fyi, i was able to successfully patch bootstrap-salt.sh to support a "script_args" of "stable 2015.5" it works for me on centos now...

jetpak avatar Feb 23 '16 08:02 jetpak

Seems to me that all the comments on this ticket are about locking version of salt to deal with the regressions with each new release. But, I don't see anything about fixing this.

Any chance a fix is in the works?

shawnbutts avatar Feb 23 '16 12:02 shawnbutts

@jetpak, thanks for reporting. This is a duplicate of #31014. Unfortunately, the bootstrap script does not currently support installing from a specific package version, although the develop version of bootstrap does support this for ubuntu, but you can always get the repo for a specific salt version at https://repo.saltstack.com/yum/redhat/$releasever/$basearch/archive/<version>.

jfindlay avatar Feb 23 '16 16:02 jfindlay