Ask Your Question
0

replace autofs mount with fstab entry

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

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
1

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

Nizen gravatar image

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

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

Comments

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 -0500 )edit
1

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 -0500 )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 -0500 )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 -0500 )edit
1

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

Nizen gravatar imageNizen ( 2016-07-11 12:49:24 -0500 )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

Stats

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

Seen: 98 times

Last updated: Jul 08 '16