瀏覽代碼

Extend by mkfs for XFS filesystem

Change-Id: I3a6a8fc227cb9abd785b342584038e34d57a4175
pull/100/merge
Jakub Pavlik 7 年之前
父節點
當前提交
8e2140a8f4
共有 2 個文件被更改,包括 18 次插入1 次删除
  1. +2
    -1
      README.rst
  2. +16
    -0
      linux/storage/disk.sls

+ 2
- 1
README.rst 查看文件

@@ -1284,7 +1284,8 @@ disk without any existing partitions.
- size: 200 #size in MB
type: fat32
- size: 300 #size in MB
type: ext4
mkfs: True
type: xfs
/dev/vda1:
partitions:
- size: 5

+ 16
- 0
linux/storage/disk.sls 查看文件

@@ -32,6 +32,22 @@ create_partition_{{ disk_name }}_{{ loop.index }}:
- require:
- module: create_disk_label

{%- if partition.get('mkfs') %}

{%- if partition.type == "xfs" %}

mkfs_partition_{{ disk_name }}_{{ loop.index }}:
module.run:
- name: xfs.mkfs
- device: {{ disk_name }}{{ loop.index }}
- unless: "blkid {{ disk_name }}{{ loop.index }} {{ disk_name }}p{{ loop.index }} | grep xfs"
- require:
- module: create_partition_{{ disk_name }}_{{ loop.index }}

{%- endif %}

{%- endif %}

{% set end_size = end_size + partition.size -%}

{%- endfor %}

Loading…
取消
儲存