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] mount.mounted options are order specific for persist #62556

Closed
nicholasmhughes opened this issue Aug 29, 2022 · 0 comments · Fixed by #62557
Closed

[BUG] mount.mounted options are order specific for persist #62556

nicholasmhughes opened this issue Aug 29, 2022 · 0 comments · Fixed by #62557
Labels
Bug broken, incorrect, or confusing behavior severity-low 4th level, cosemtic problems, work around exists

Comments

@nicholasmhughes
Copy link
Collaborator

Description
Similar to (but not the same as) #19003 and #55769

Essentially, mount options provided to the state are natural sort ordered and expected to be in that order in the persisted mount file (such as /etc/fstab). This is problematic for writing states to take over management of existing mounts because a state cannot be written in a way that will run "clean" if the options order is not sorted in fstab.

Setup

# /srv/salt/mount.sls

alpine:
  mount.mounted:
    - name: /mnt/iso
    - device: /srv/salt/alpine-standard-3.16.2-x86_64.iso
    - fstype: iso9660
    - opts:
      - auto
      - loop
      - ro
    - persist: True
    - mkmnt: True

Running this state shows that changes will be made even though the mount is present with all options present:

# /etc/fstab
...
/srv/salt/alpine-standard-3.16.2-x86_64.iso             /mnt/iso        iso9660 auto,ro,loop    0 0

Expected behavior
I would expect that the options would be compared irrespective of order, since order of the options is not important to mount.

Versions Report

salt --versions-report (Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)
Salt Version:
          Salt: 3005+0na.c57a277
 
Dependency Versions:
          cffi: Not Installed
      cherrypy: Not Installed
      dateutil: Not Installed
     docker-py: Not Installed
         gitdb: Not Installed
     gitpython: Not Installed
        Jinja2: 3.1.2
       libgit2: Not Installed
      M2Crypto: Not Installed
          Mako: Not Installed
       msgpack: 1.0.4
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     pycparser: Not Installed
      pycrypto: 2.6.1
  pycryptodome: 3.15.0
        pygit2: Not Installed
        Python: 3.7.3 (default, Jan 22 2021, 20:04:44)
  python-gnupg: Not Installed
        PyYAML: 6.0
         PyZMQ: 23.2.1
         smmap: Not Installed
       timelib: Not Installed
       Tornado: 4.5.3
           ZMQ: 4.3.4
 
System Versions:
          dist: debian 10 buster
        locale: UTF-8
       machine: x86_64
       release: 4.19.0-21-amd64
        system: Linux
       version: Debian GNU/Linux 10 buster
@nicholasmhughes nicholasmhughes added the Bug broken, incorrect, or confusing behavior label Aug 29, 2022
nicholasmhughes added a commit to nicholasmhughes/salt that referenced this issue Aug 29, 2022
@OrangeDog OrangeDog added the severity-low 4th level, cosemtic problems, work around exists label Aug 30, 2022
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-low 4th level, cosemtic problems, work around exists
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants