Skip to content

Duplicate fstab entries when using mount.mounted RHEL7 #42775

@retailslu

Description

@retailslu

Description of Issue/Question

Trying to understand why mount.mounted created a duplicate fstab entry if the existing entry doesn't have the dump pass_num fields listed (0 0)

BEFORE
#grep test /etc/fstab
someshare:/test /mnt1 nfs bg,hard,vers=3,intr,timeo=600,tcp 0 0
someshare:/test /mnt2 nfs soft 0 0
someshare:/test /mnt3 nfs bg,hard,vers=3,intr,timeo=600,tcp

run Salt NFS state. state basically does some checks to make sure certain options are enabled and also retains any existing options outside of those set by state if they don't conflict
{{mount_point}}:
mount.mounted:
- device: {{mount_source}}
- fstype: nfs
- opts: {{std_opt}}{% print ','.join(tar_opt) %}
- mount: False
- dump: 0
- mkmnt: True
- pass_num: 0
- persist: True

AFTER
mnt1 - no change
mnt2 - additional options put in place
mnt3 - dupicate entry. original entry still exists and now there is a new entry with the dump passnum (0 0) values. I would expect Salt to update the existing line and not recreate leaving the old line in place.
#grep test /etc/fstab
someshare:/test /mnt1 nfs bg,hard,vers=3,intr,timeo=600,tcp 0 0
someshare:/test /mnt2 nfs soft,hard,vers=3,intr,timeo=600,tcp 0 0
someshare:/test /mnt3 nfs bg,hard,vers=3,intr,timeo=600,tcp
someshare:/test /mnt3 nfs bg,hard,vers=3,intr,timeo=600,tcp 0 0

Setup

(Please provide relevant configs and/or SLS files (Be sure to remove sensitive info).)
{{mount_point}}:

  mount.mounted:
    - device: {{mount_source}}
    - fstype: nfs
    - opts: {{std_opt}}{% print ','.join(tar_opt) %}
    - mount: False
    - dump: 0
    - mkmnt: True
    - pass_num: 0
    - persist: True

Steps to Reproduce Issue

(Include debug logs if possible and relevant.)

Versions Report

Salt Version:
Salt: 2016.11.3

Dependency Versions:
cffi: 1.6.0
cherrypy: 3.2.2
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: 0.21.1
Mako: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.4.6
mysql-python: 1.2.5
pycparser: 2.14
pycrypto: 2.6.1
pygit2: Not Installed
Python: 2.7.5 (default, Aug 2 2016, 04:20:16)
python-gnupg: 0.3.6
PyYAML: 3.11
PyZMQ: 15.3.0
RAET: Not Installed
smmap: 0.8.1
timelib: Not Installed
Tornado: 4.2.1
ZMQ: 4.1.4

System Versions:
dist: redhat 7.3 Maipo
machine: x86_64
release: 3.10.0-514.6.1.el7.x86_64
system: Linux
version: Red Hat Enterprise Linux Server 7.3 Maipo

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Priority 2bugbroken, incorrect, or confusing behaviorseverity-medium3rd level, incorrect or bad functionality, confusing and lacks a work aroundstale

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions