Explorar el Código

Allow setting mountpoint permissions

tags/2016.12
Filip Pytloun hace 9 años
padre
commit
bd3e303410
Se han modificado 2 ficheros con 19 adiciones y 1 borrados
  1. +16
    -1
      linux/storage/mount.sls
  2. +3
    -0
      tests/pillar/storage.sls

+ 16
- 1
linux/storage/mount.sls Ver fichero

@@ -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 Ver fichero

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

Cargando…
Cancelar
Guardar