salt: pkg.installed does not seem to refresh the repo database, no matter what

Description of Issue/Question

With the following state file

install:
  pkg.installed:
    - name: some-packagename
    - refresh: True

both salt-ssh, and regular salt fail to call apt-get update (I’m expecting it to be called, based on https://docs.saltstack.com/en/latest/ref/states/all/salt.states.pkg.html#salt.states.pkg.installed) on an Ubuntu system (really doubt this is ubuntu-specific, though). This is deduced by me simply by looking at /var/cache/apt/lists, and noting that no new files are created for a new repo I’ve got in /etc/apt/sources.list.d (running apt-get update manually creates these files though).

Setup

See SLS file above (the - refresh: True line can be removed as well, and the effect will still be the same). Create any valid file in /var/lib/apt/sources.list.d

Steps to Reproduce Issue

See description above.

Versions Report

Salt Version:
           Salt: 2016.11.0
 
Dependency Versions:
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: 1.5
          gitdb: 0.5.4
      gitpython: 0.3.2 RC1
          ioflo: Not Installed
         Jinja2: 2.7.2
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: 0.9.1
   msgpack-pure: Not Installed
 msgpack-python: 0.4.6
   mysql-python: 1.2.3
      pycparser: Not Installed
       pycrypto: 2.6.1
         pygit2: Not Installed
         Python: 2.7.6 (default, Oct 26 2016, 20:30:19)
   python-gnupg: Not Installed
         PyYAML: 3.10
          PyZMQ: 14.0.1
           RAET: Not Installed
          smmap: 0.8.2
        timelib: Not Installed
        Tornado: 4.2.1
            ZMQ: 4.0.5
 
System Versions:
           dist: Ubuntu 14.04 trusty
        machine: x86_64
        release: 3.13.0-103-generic
         system: Linux
        version: Ubuntu 14.04 trusty

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 19 (19 by maintainers)

Most upvoted comments

@Ch3LL @gtmanfred already pinged me about this, I did a bisect too and found the same issue.

@damon-atkins I’m reverting your changes to the rtag behavior in https://github.com/saltstack/salt/pull/38113. We’ll need to figure out a better approach to whatever you were trying to do.