Browse Source

Allow setting mountpoint permissions

tags/2016.12
Filip Pytloun 9 years ago
parent
commit
bd3e303410
2 changed files with 19 additions and 1 deletions
  1. +16
    -1
      linux/storage/mount.sls
  2. +3
    -0
      tests/pillar/storage.sls

+ 16
- 1
linux/storage/mount.sls View File

- onlyif: "test `blkid {{ mount.device }} >/dev/null;echo $?` -eq 2" - onlyif: "test `blkid {{ mount.device }} >/dev/null;echo $?` -eq 2"
- require_in: - require_in:
- mount: {{ mount.path }} - mount: {{ mount.path }}
{%- if mount.file_system == 'xfs' %}
- require:
- pkg: xfs_packages
{%- endif %}


{%- endif %} {%- endif %}


- mkmnt: True - mkmnt: True
- opts: {{ mount.get('opts', 'defaults,noatime') }} - opts: {{ mount.get('opts', 'defaults,noatime') }}
{%- if mount.file_system == 'xfs' %} {%- if mount.file_system == 'xfs' %}
require:
- require:
- pkg: xfs_packages - pkg: xfs_packages
{%- endif %} {%- endif %}


{%- if mount.user is defined %}
{{ mount.path }}_permissions:
file.directory:
- name: {{ mount.path }}
- user: {{ mount.user }}
- group: {{ mount.get('group', 'root') }}
- mode: {{ mount.get('mode', 755) }}
- require:
- mount: {{ mount.path }}
{%- endif %}

{%- endif %} {%- endif %}


{%- endfor %} {%- endfor %}

+ 3
- 0
tests/pillar/storage.sls View File

path: /srv/dummy path: /srv/dummy
file_system: xfs file_system: xfs
options: "noatime,nobarrier,logbufs=8" options: "noatime,nobarrier,logbufs=8"
user: nobody
group: nogroup
mode: 755

Loading…
Cancel
Save