Ask Your Question

replace autofs mount with fstab entry

asked 2016-07-08 10:34:46 -0600

johncfrank gravatar image

Somewhat new to puppet here. I need replace an autofs mount using the same source and same destination only using fstab instead of autofs which is what it's currently mounted as.

I seemed to figure out how to get the mount portion to work, including adding the necessary line to the /etc/fstab file, but I can't figure out how to create the mount point. It won't mount because the mount point doesn't exist which you'd manually do with a mkdir. So say I want to mount to /example/vol1, where /example exists already, but vol1 doesn't. How can I do this? I'm running CentOS 7, and puppet 3.7.2.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2016-07-08 15:17:07 -0600

Nizen gravatar image

updated 2016-07-08 15:17:55 -0600

Do you have an existing template for fstab?

To make sure the directory exists:

class vol1 {
  file { '/example/vol1/':
    ensure => 'directory',
    owner => 0,
    group => 0,
    mode => 755 
edit flag offensive delete link more


Where does that entry need to go? Is it a separate file, if so what directory should it be in?

johncfrank gravatar imagejohncfrank ( 2016-07-11 04:46:30 -0600 )edit

You should create a module in your puppet path... /etc/puppet/$environment/vol1/manifest/init.pp for example. Do you have an fstab template you are wanting to use?

Nizen gravatar imageNizen ( 2016-07-11 10:12:24 -0600 )edit

I know it currently has one (due to the comments in the fstab file), but I have no idea where it's located.

johncfrank gravatar imagejohncfrank ( 2016-07-11 10:27:26 -0600 )edit

The fstab is updating with my new mount, I just can't get the directory creation to work, even with what you suggested above.

johncfrank gravatar imagejohncfrank ( 2016-07-11 10:50:41 -0600 )edit

Make sure that you put the module in the site.pp. include 'vol1'

Nizen gravatar imageNizen ( 2016-07-11 12:49:24 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2016-07-08 10:34:46 -0600

Seen: 163 times

Last updated: Jul 08 '16