Browse Source

Install xfsprogs when needed

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

+ 19
- 0
linux/storage/mount.sls View File

@@ -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 View File

@@ -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…
Cancel
Save