Search code examples
centossalt-project

Salt pkg.installed not checking installation properly


I'm currently installing Solr in a specific version, using the following Salt state:

solr_install:                                                                                                          
  pkg.installed:                                                                                                       
    - name: solr                                                                                                       
    - fromrepo: {{ repo }}                                                                                      
    - version: {{ solr_vers }}

In which solr_vers stands for 5.5.5. After running the state, I get:

      ID: solr_install                                                                                             
Function: pkg.installed                                                                                            
    Name: solr                                                                                                     
  Result: False                                                                                                    
 Comment: The following packages failed to install/update: solr=5.5.5

But If access the server and try to install it manually, I get:

yum install solr-5.5.5
Package 1:solr-5.5.5.x86_64 already installed and latest version

How does Salt checks for the installation?


Solution

  • It seems there's an issue related to that and it's still open. https://github.com/saltstack/salt/issues/27400

    What worked for me was changing the RPM version and release.

    Ever since, I've been working with Solr 6.6.4 and I created my own RPM using FPM. It's release 2 and version 6.6.4, so it reads: solr-6.6.4-2. I didn't have the problem after that.