Pārlūkot izejas kodu

Install xfsprogs when needed

tags/2016.12
Filip Pytloun pirms 9 gadiem
vecāks
revīzija
3954bad18c
2 mainītis faili ar 25 papildinājumiem un 0 dzēšanām
  1. +19
    -0
      linux/storage/mount.sls
  2. +6
    -0
      tests/pillar/storage.sls

+ 19
- 0
linux/storage/mount.sls Parādīt failu

{%- from "linux/map.jinja" import storage with context %} {%- from "linux/map.jinja" import storage with context %}
{%- if storage.enabled %} {%- 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() %} {%- for name, mount in storage.mount.iteritems() %}


{%- if mount.enabled %} {%- if mount.enabled %}
- fstype: {{ mount.file_system }} - fstype: {{ mount.file_system }}
- mkmnt: True - mkmnt: True
- opts: {{ mount.get('opts', 'defaults,noatime') }} - opts: {{ mount.get('opts', 'defaults,noatime') }}
{%- if mount.file_system == 'xfs' %}
require:
- pkg: xfs_packages
{%- endif %}


{%- endif %} {%- endif %}



+ 6
- 0
tests/pillar/storage.sls Parādīt failu

size: 512M size: 512M
mount: mount:
path: /srv path: /srv
disk1:
enabled: true
device: /dev/dummy
path: /srv/dummy
file_system: xfs
options: "noatime,nobarrier,logbufs=8"

Notiek ielāde…
Atcelt
Saglabāt