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

file.line adding line every time #50254

Closed
jmcook1 opened this issue Oct 26, 2018 · 3 comments

Comments

Projects
None yet
4 participants
@jmcook1
Copy link

commented Oct 26, 2018

Description of Issue/Question

2018.3.3 appears to have a bug with file.line. The line is always added even if it already exists. This does not happen on 2018.3.2 minions. I've tried a variety of after/before lines and the line is always added.

Setup

yum.sls:

disable_epel_check_mk_install:
  file.line:
    - name: /etc/yum.repos.d/epel.repo
    - backup: True
    - mode: Ensure
    - location:
      - start
    - before: '\[epel-debuginfo\]'
    - indent: True
    - content: 'exclude=check-mk-agent*'
    - onlyif: 'test -e /etc/yum.repos.d/epel.repo'

Contents of /etc/yum.repos.d/epel.repo:


/etc/yum.repos.d/epel.repo
[epel]
name=Extra Packages for Enterprise Linux 7 - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7

exclude=check-mk-agent*
[epel-debuginfo]
name=Extra Packages for Enterprise Linux 7 - $basearch - Debug
#baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch/debug
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-7&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=1

[epel-source]
name=Extra Packages for Enterprise Linux 7 - $basearch - Source
#baseurl=http://download.fedoraproject.org/pub/epel/7/SRPMS
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-source-7&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=1

Steps to Reproduce Issue

Run the state on the minion:

# salt-call state.apply yum

Versions Report

Salt Version:
           Salt: 2018.3.3
 
Dependency Versions:
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: Not Installed
      docker-py: Not Installed
          gitdb: Not Installed
      gitpython: Not Installed
          ioflo: Not Installed
         Jinja2: 2.7.2
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.5.6
   mysql-python: Not Installed
      pycparser: Not Installed
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: Not Installed
         Python: 2.7.5 (default, Jul 13 2018, 13:06:57)
   python-gnupg: Not Installed
         PyYAML: 3.11
          PyZMQ: 15.3.0
           RAET: Not Installed
          smmap: Not Installed
        timelib: Not Installed
        Tornado: 4.2.1
            ZMQ: 4.1.4
 
System Versions:
           dist: centos 7.5.1804 Core
         locale: UTF-8
        machine: x86_64
        release: 3.10.0-862.14.4.el7.x86_64
         system: Linux
        version: CentOS Linux 7.5.1804 Core

The master is running 2018.8.2 and running the state from the master yields the same result.

@Ch3LL

This comment has been minimized.

Copy link
Contributor

commented Oct 26, 2018

looks like i'm able to replicate this although i'm having a hard time bisecting it. Bisect showed these:

The first bad commit could be any of:
d2af81e9c7a9f238513b6b05d5d7b46dd63dcfe9
f29815b49b3c1c198bdb7e8d2616d9648b80e9f3

we will need to get this fixed thanks

@Ch3LL Ch3LL added this to the Approved milestone Oct 26, 2018

@Ch3LL

This comment has been minimized.

Copy link
Contributor

commented Oct 26, 2018

ping @t0fik looks like those commits are a part of your PR here: #46291

any chance you can take a look here?

@t0fik

This comment has been minimized.

Copy link
Contributor

commented Oct 31, 2018

@Ch3LL Sure. On weekend I should have some time, to test it. I've got some idea what might not work.

t0fik added a commit to jdsieci/salt that referenced this issue Nov 2, 2018

t0fik added a commit to jdsieci/salt that referenced this issue Nov 2, 2018

t0fik added a commit to jdsieci/salt that referenced this issue Nov 2, 2018

@Ch3LL Ch3LL closed this Jan 18, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.