> I'm trying to get a simple NFS mount to work with Puppet, using this:
[snip]
> atboot => "true,
Missing a "
(:
--
Ben Hughes || http://www.puppetlabs.com/
> I caught that, thank you -- I've wiped my glasses thoroughly ;-)
(:
> One other issue I'm running into is I would like the client to
> *create* (mkdir) the mountpoint with the correct permissions if it
> doesn't exist. I don't see a way that can be done within the mount
> {} construct...
No, mount has no way to create the directories, it's purely an
interface to the mount command.
> is there a clever way I can do this for a multiple of
> directories. Maybe from an array.
Do it automatically? Rather than just using a file{...} call?
file{ [ "/srv/mount1" , "/srv/mount2" ]: ... }
and so forth.
> So are you saying for the "absent" items, we'll need to include a
> file{} directive to remove the mount point, too?
The mount handler won't go around deleting directories for you,
thankfully. (:
Do you create the mount point before you mount it, a la?
file{ "/srv/fraser":
ensure => directory,
owner => "root",
mode => 0755,
}
mount{ "/srv/fraser":
device => "server:/path/fraser",
fstype => "nfs",
ensure => "mounted",
options => "defaults",
atboot => true,
require => File[ "/srv/fraser" ]
}
You could probably make a define to wrap around both to ensure => absent
the directory after you ensure => absent the mount point?
Regards, Stefan.
> --
> You received this message because you are subscribed to the Google Groups "Puppet Users" group.
> To post to this group, send email to puppet...@googlegroups.com.
> To unsubscribe from this group, send email to puppet-users...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
>
# Creation
file { '/mnt/foo': ensure => directory }
mount { '/mnt/foo':
device => ...,
ensure => mounted,
require => File['/mnt/foo'],
}
# Delete (i think force is needed here)
file { '/mnt/foo': ensure => absent, force => true}
mount { '/mnt/foo':
ensure => absent,
before => File['/mnt/foo'],
}
-Stefan
> I manually created the mount points and incorrectly assumed the mount
> process would automatically create the point if it didn't exist.
Afraid it doesn't, they have to exist before hand.
> Can you explain the wrap you were talking about?
Either make a module for nfs and have the function create the mountpoints
on "ensure" and rmdir them after "absent", would be one way.
Or use run stages and have a "post" stage unmount them and tidy up the
directories you no longer require.