Created
October 21, 2013 21:45
-
-
Save kevinastone/7091553 to your computer and use it in GitHub Desktop.
Macro for mounting devices for Salt Stack.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% macro mount_device(app, device, dir) -%} | |
{{ app }}-formatted: | |
cmd.run: | |
- name: "mkfs.ext4 /dev/{{ device }}" | |
- unless: "file -sL /dev/{{ device }} | grep -q ext4" | |
{{ app }}-mounted: | |
mount.mounted: | |
- name: "{{ dir }}" | |
- device: /dev/{{ device }} | |
- fstype: ext4 | |
- mkmnt: true | |
- require: | |
- cmd: {{ app }}-formatted | |
{%- endmacro %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment