Przeglądaj źródła

Allow setting mountpoint permissions

tags/2016.12
Filip Pytloun 9 lat temu
rodzic
commit
bd3e303410
2 zmienionych plików z 19 dodań i 1 usunięć
  1. +16
    -1
      linux/storage/mount.sls
  2. +3
    -0
      tests/pillar/storage.sls

+ 16
- 1
linux/storage/mount.sls Wyświetl plik

@@ -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 Wyświetl plik

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

Ładowanie…
Anuluj
Zapisz