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.

31 lines
663B

  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. {%- if not mount.file_system in ['nfs'] %}
  6. mkfs_{{ mount.device}}:
  7. cmd.run:
  8. - name: "mkfs.{{ mount.file_system }} -L {{ name }} {{ mount.device }}"
  9. - onlyif: "test `blkid {{ mount.device }} >/dev/null;echo $?` -eq 2"
  10. - require_in:
  11. - mount: {{ mount.path }}
  12. {%- endif %}
  13. {{ mount.path }}:
  14. mount.mounted:
  15. - device: {{ mount.device }}
  16. - fstype: {{ mount.file_system }}
  17. - mkmnt: True
  18. - opts: {{ mount.get('opts', 'defaults,noatime') }}
  19. {%- endif %}
  20. {%- endfor %}
  21. {%- endif %}