Using autofs with a NAS in Chef

autofs isn’t so bad, but when it’s been a while, it can make you pull your hair out.  Been there, done that.  Now here’s the result of that for you to benefit from.  This Chef recipe simply installs autofs and its dependencies, and sets up a mountpoint called /media that’s managed through autofs.  The recipe is certainly meant to be updated; this is just a general template.  The NAS hostname/export below are hardcoded, but can be defined via attribute.

Note that this will overwrite /etc/auto.master, so if you already have something important in there, you should factor that into the cookbook as well and update accordingly.

Note that this was written for and tested on CentOS 6.  You will need to update it accordingly for your distro.


Leave a Reply

Your email address will not be published. Required fields are marked *