Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] 3002.6 pkgrepo.managed creates multiple identical lines in sources.list.d file for Ubuntu #60220

Open
rasstef opened this issue May 20, 2021 · 0 comments
Labels
Bug broken, incorrect, or confusing behavior severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around
Milestone

Comments

@rasstef
Copy link

rasstef commented May 20, 2021

Description

pkgrepo.managed:
  - name: {{ repostring }}
  - file: /etc/apt/sources.list.d/foo.list
  - key_url: {{ keyurl }}

This code in a state sls file causes the same line to be repeated in /etc/apt/sources.list.d/*.list:

deb http://repositories.tools/platforms/mo bionic main
deb http://repositories.tools/platforms/mo bionic main
deb http://repositories.tools/platforms/mo bionic main
deb http://repositories.tools/platforms/mo bionic main
deb http://repositories.tools/platforms/mo bionic main
deb http://repositories.tools/platforms/mo bionic main
deb http://repositories.tools/platforms/mo bionic main

Every state.apply adds a new identical line.

Setup

# cat foo/init.sls
{% from "foo/map.jinja" import foo with context %}

foo.repo:
  pkgrepo.managed:
    - name: {{ foo.repostring }}
    - file: /etc/apt/sources.list.d/foo.list
    - key_url: {{ foo.keyurl }}


# cat foo/map.jinja
{% set foo = salt['grains.filter_by']({
    'xenial': {
        'repostring': 'deb http://repositories.tools/platforms/mo xenial main',
        'keyurl': 'http://repositories.tools/keys/foo.gpg',
        'pkg': 'foo',
        'version': '11.1'
    },
    'bionic': {
        'repostring': 'deb http://repositories.tools/platforms/mo bionic main',
        'keyurl': 'http://repositories.tools/platforms/all/all.key',
        'pkg': 'foo',
        'version': '11.2'
    },
    'focal': {
        'repostring': 'deb http://repositories.tools/platforms/mo focal main',
        'keyurl': 'http://repositories.tools/platforms/all/all.key',
        'pkg': 'foo',
        'version': '11.3'
    },
}, grain='oscodename') %}

Steps to Reproduce the behavior

# salt-call state.apply

every state.apply adds a new identical line to the sources.list.d file

Expected behavior
Only one line of the same kind in the sources.list.d file.

Versions Report

salt --versions-report (Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)
# salt --versions-report
Salt Version:
          Salt: 3002.6

Dependency Versions:
          cffi: Not Installed
      cherrypy: unknown
      dateutil: 2.7.3
     docker-py: Not Installed
         gitdb: Not Installed
     gitpython: Not Installed
        Jinja2: 2.10.1
       libgit2: 0.28.3
      M2Crypto: Not Installed
          Mako: Not Installed
       msgpack: 0.6.2
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     pycparser: Not Installed
      pycrypto: 2.6.1
  pycryptodome: 3.6.1
        pygit2: 1.0.3
        Python: 3.8.5 (default, Jan 27 2021, 15:41:15)
  python-gnupg: 0.4.5
        PyYAML: 5.3.1
         PyZMQ: 18.1.1
         smmap: Not Installed
       timelib: Not Installed
       Tornado: 4.5.3
           ZMQ: 4.3.2

System Versions:
          dist: ubuntu 20.04 focal
        locale: utf-8
       machine: x86_64
       release: 5.4.0-66-generic
        system: Linux
       version: Ubuntu 20.04 focal
</details>

**Additional context**
Add any other context about the problem here.
@rasstef rasstef added Bug broken, incorrect, or confusing behavior needs-triage labels May 20, 2021
@sagetherage sagetherage changed the title [BUG] pkgrepo.managed creates multiple identical lines in sources.list.d file for Ubuntu [BUG] 3002.6 pkgrepo.managed creates multiple identical lines in sources.list.d file for Ubuntu May 21, 2021
@sagetherage sagetherage added severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around and removed needs-triage labels May 21, 2021
@sagetherage sagetherage added this to the Approved milestone May 21, 2021
javierbertoli added a commit to netmanagers/docker-formula that referenced this issue Mar 1, 2022
javierbertoli added a commit to netmanagers/docker-formula that referenced this issue Mar 1, 2022
javierbertoli added a commit to netmanagers/nginx-formula that referenced this issue Mar 1, 2022
myii pushed a commit to saltstack-formulas/docker-formula that referenced this issue Mar 2, 2022
arvados-bot pushed a commit to arvados/arvados-formula that referenced this issue Mar 4, 2022
Entries are being duplicated as described in

* saltstack/salt#60220 and
* saltstack/salt#59785 (comment)

Arvados-DCO-1.1-Signed-off-by: Javier Bértoli <jbertoli@curii.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around
Projects
None yet
Development

No branches or pull requests

2 participants