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

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

{%- endif %}

@@ -38,10 +42,21 @@ mkfs_{{ mount.device}}:
- mkmnt: True
- opts: {{ mount.get('opts', 'defaults,noatime') }}
{%- if mount.file_system == 'xfs' %}
require:
- require:
- pkg: xfs_packages
{%- 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 %}

{%- endfor %}

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

@@ -23,3 +23,6 @@ linux:
path: /srv/dummy
file_system: xfs
options: "noatime,nobarrier,logbufs=8"
user: nobody
group: nogroup
mode: 755

Loading…
Cancel
Save