salt: [BUG] 3002 salt-minion does not restart when upgraded using salt-master

**Description**
Upgrading salt-minion on Ubuntu using salt-master version 3002  trying to upgrade salt-minion running 3001 to 3002 fails to restart salt-minion.

**Setup**
`{% from "salt-minion/map.jinja" import saltstack with context %}

salt-minion_repo:
  pkgrepo.managed:
    - proxy: {{ pillar['http_proxy']['address'] }}
    - humanname: saltstack
    - name: deb {{ saltstack.repo_url }}
    - file: /etc/apt/sources.list.d/saltstack.list
    - key_url: salt://salt-minion/files/SALTSTACK-GPG-KEY.pub
    - architectures: amd64
    - refresh_db: true
    - refresh: true

salt-minion_packages:
  pkg.installed:
    - name: salt-minion
    - version: {{ pillar['saltstack']['minion-version'] }}
    - require:
       - pkgrepo: salt-minion_repo
`

**Steps to Reproduce the behavior**
salt -v -C ${HOST} pkg.upgrade dist_upgrade=True;
or state.apply on that host

**Expected behavior**
I expect salt-minion to be upgraded and restarted. The upgrades happens, but salt-minion is never restarted. Applying a apt dist-upgrade directly on the host works as expected. 


**Versions Report**
3002

Additional context Add any other context about the problem here.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 4
  • Comments: 18 (13 by maintainers)

Most upvoted comments

I ran into this issue as well while upgrading from 3001.7 to 3002.6 … the way from the FAQ does not work, that’s what I used before. I found my way around with this:

  • update the APT repository from 3001 to 3002
  • salt minion cmd.run_bg 'echo "exit 101" > /usr/sbin/policy-rc.d && chmod +x /usr/sbin/policy-rc.d && apt-get update && apt-get install -y --allow-change-held-packages salt-minion salt-common ; rm /usr/sbin/policy-rc.d; sleep 5 && service salt-minion restart; sleep 5 && service salt-minion restart'

@garethgreenaway I have two questions about this. First, when pkg.list_upgrades reported a new salt-minion version, I used to be able to run salt 'my-debian-minion' pkg.upgrade and the salt-minion package would be upgraded and restarted correctly. What changed?

Second, although I’ve read https://docs.saltstack.com/en/latest/faq.html#what-is-the-best-way-to-restart-a-salt-minion-daemon-using-salt-after-upgrade, I don’t see a complete example. I want a state or an orchestration that I run against an arbitrary minion or minions, something like salt 'my-debian-minion*' state.apply upgrade-salt or salt-run state.orchestrate orch.upgrade-salt pillar='{minions: "my-debian-minion*"}' – is there such an example out there? (I started working on an orchestration using pkg.latest, then saw the comment by @boltronics just above this one.)