Browse Source

Merge "improve mkfs condition and make fs_type for partitioning optional"

pull/133/head
Filip Pytloun 7 years ago
parent
commit
1510389333
2 changed files with 3 additions and 1 deletions
  1. +2
    -0
      linux/storage/disk.sls
  2. +1
    -1
      linux/storage/mount.sls

+ 2
- 0
linux/storage/disk.sls View File

- name: partition.mkpart - name: partition.mkpart
- device: {{ disk_name }} - device: {{ disk_name }}
- part_type: primary - part_type: primary
{%- if partition.type is defined %}
- fs_type: {{ partition.type }} - fs_type: {{ partition.type }}
{%- endif %}
- start: {{ end_size }}MB - start: {{ end_size }}MB
- end: {{ end_size + partition.size }}MB - end: {{ end_size + partition.size }}MB
- unless: "blkid {{ disk_name }}{{ loop.index }} {{ disk_name }}p{{ loop.index }}" - unless: "blkid {{ disk_name }}{{ loop.index }} {{ disk_name }}p{{ loop.index }}"

+ 1
- 1
linux/storage/mount.sls View File

mkfs_{{ mount.device}}: mkfs_{{ mount.device}}:
cmd.run: cmd.run:
- name: "mkfs.{{ mount.file_system }} -L {{ name }} {{ mount.device }}" - name: "mkfs.{{ mount.file_system }} -L {{ name }} {{ mount.device }}"
- onlyif: "test `blkid {{ mount.device }} >/dev/null;echo $?` -eq 2"
- onlyif: "test `blkid {{ mount.device }} | grep -q TYPE;echo $?` -eq 1"
- require_in: - require_in:
- mount: {{ mount.path }} - mount: {{ mount.path }}
{%- if mount.file_system == 'xfs' %} {%- if mount.file_system == 'xfs' %}

Loading…
Cancel
Save