瀏覽代碼

Install xfsprogs when needed

tags/2016.12
Filip Pytloun 9 年之前
父節點
當前提交
3954bad18c
共有 2 個文件被更改,包括 25 次插入0 次删除
  1. +19
    -0
      linux/storage/mount.sls
  2. +6
    -0
      tests/pillar/storage.sls

+ 19
- 0
linux/storage/mount.sls 查看文件

@@ -1,6 +1,21 @@
{%- from "linux/map.jinja" import storage with context %}
{%- if storage.enabled %}

{%- set install_xfs = False %}

{%- for name, mount in storage.mount.iteritems() %}
{%- if mount.enabled and mount.file_system == 'xfs' %}
{%- set install_xfs = True %}
{%- endif %}
{%- endfor %}

{%- if install_xfs == True %}
xfs_packages:
package.installed:
- name: xfsprogs
{%- endif %}


{%- for name, mount in storage.mount.iteritems() %}

{%- if mount.enabled %}
@@ -22,6 +37,10 @@ mkfs_{{ mount.device}}:
- fstype: {{ mount.file_system }}
- mkmnt: True
- opts: {{ mount.get('opts', 'defaults,noatime') }}
{%- if mount.file_system == 'xfs' %}
require:
- pkg: xfs_packages
{%- endif %}

{%- endif %}


+ 6
- 0
tests/pillar/storage.sls 查看文件

@@ -17,3 +17,9 @@ linux:
size: 512M
mount:
path: /srv
disk1:
enabled: true
device: /dev/dummy
path: /srv/dummy
file_system: xfs
options: "noatime,nobarrier,logbufs=8"

Loading…
取消
儲存