Saltstack Official Linux Formula
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
605B

  1. {%- from "linux/map.jinja" import storage with context %}
  2. {%- if storage.enabled %}
  3. {%- for name, mount in storage.mount.iteritems() %}
  4. {%- if mount.enabled %}
  5. mkfs_{{ mount.device}}:
  6. cmd.run:
  7. - name: "mkfs.{{ mount.file_system }} -L {{ name }} {{ mount.device }}"
  8. - onlyif: "test `blkid {{ mount.device }} >/dev/null;echo $?` -eq 2"
  9. - require_in:
  10. - mount: {{ mount.path }}
  11. {{ mount.path }}:
  12. mount.mounted:
  13. - device: {{ mount.device }}
  14. - fstype: {{ mount.file_system }}
  15. - mkmnt: True
  16. - opts: {{ mount.get('opts', 'defaults,noatime') }}
  17. {%- endif %}
  18. {%- endfor %}
  19. {%- endif %}