Working with disks, configuring their mount points, and gathering useful data about them at times of emergency are some of the most critical tasks in system management. In this recipe, you will learn how Salt helps us perform all of these tasks efficiently.
We will use the same minion and logical volume configured in the previous recipe.
Create a new state directory called
disk
.Create and edit
/opt/salt-cookbook/staging/disk/format.sls
to have the following entries:include: - lvm backup_volume: blockdev.formatted: - name: /dev/backup_vg/backup_lv - fs_type: ext4 - require: - lvm: backup_lv
Create and edit
/opt/salt-cookbook/staging/disk/mount.sls
to have the following entries:include: - disk.format backup_mount: mount.mounted: - name: /backup - device: /dev/backup_vg/backup_lv - fstype: ext4 - mkmnt: True - opts: defaults - persist: True - mount: True - dump: 0 - pass_num: 0 - require...