saltstack / saltstack/salt

[BUG] OpenBSD - False-failure pkg_add ‘stems with flavors’

Open
#58,855 10 comments 0 reactions 1 assignee View on GitHub

@krionbsd is already working on this.

Since Mar 30, 2021.

bug OpenBSD severity-medium
Dominant language
Python
Stars
15.7k
Forks
5.6k
Avg merge
2d 44m
Merged PRs (30d)
80

Description

OpenBSD 6.8 with distro package salt-3001.1 minion and 3001.1 master.

OpenBSD has ‘stems with flavors’ to cope with dealing with different versions of a package in the repo (https://man.openbsd.org/OpenBSD-6.8/pkg_add)

So, for example, the 6.8 packages repo has gnupg versions 1 and 2. So to ensure v2 was installed, you would run pkg_add gnupg--%gnupg2

However given the following Salt SLS :

openbsd_pkgs:
  pkg.installed:
    - pkgs:
      - gnupg--%gnupg2

The OpenBSD minion will give you a false failure:

          ID: openbsd_pkgs                                                                                                                                                
    Function: pkg.installed                                                                                                                                                  
      Result: False                                                                                                                                                          
     Comment: The following packages failed to install/update: gnupg--%gnupg2                                                                                                                                                                                 
     Started: 13:08:48.432030                                                                                                                                                
    Duration: 3390.317 ms                                                                                                                                                    
     Changes:  

This happens both on initial apply and still happens if you re-run state.apply. In all instances this is a false failure.

Meanwhile, if you login to the OpenBSD machine, it is clear that the package installed successfully because:

(1) Nothing new gets installed if you run manually AND a return code of 0 is provided:

$pkg_add gnupg--%gnupg2                                                                                                                                                                             
quirks-3.439 signed on 2020-10-31T12:23:49Z                                                                                 
$ echo $?                                                                                                               
0    

(2) pkg_info confirms it is installed ("inst"):

$ pkg_info gnupg
Information for inst:gnupg-2.2.23p0

(3) The command exists:

$ gpg2 --version
gpg (GnuPG) 2.2.23

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.