SaltStack: encrypt your HDDs with LUKS

I use LUKS to encrypt my HDDs that have sensible information and, if someone steals them, he will get a paperweight.

This statements for SaltStack encrypt the whole HDD and use the primary partition.

To generate a random password for LUKS you can use OpenSSL

openssl rand -base64 31

With the new password, the next step is to configure the pillar file for LUKS: create a file named /srv/pillar/luks.sls where you specify the password, the HDDs and the three optional values, the filesystem (by default, EXT4), the mount point (by default, /mnt) and the mount options.

Finally, copy this statements to use LUKS