Re: [Puppet Users] Help with bind option for mount

30 views
Skip to first unread message

Stefan Schulte

unread,
Jun 22, 2012, 12:20:45 PM6/22/12
to puppet...@googlegroups.com
On Fri, Jun 22, 2012 at 05:57:21AM -0700, cnjohnson wrote:
> This is my first foray into using puppet for creating and maintaining bind
> mounts (see man 8 mount). I am unsure of how to describe the state I want
> puppet to achieve. This is for creating files systems in a chroot jail. I
> am primarily unsure of how to set the "options". Is it a string, and array,
> a hash? Any help would be appreciated. Thanks!
>
> mount { "/gpfs20/home":
> ensure => mounted,
> name => "/chroot/centos5/home",
> fstype => "none",
> options => "rw,bind",
> }
>

You pass the options as a string but I see another problem here: You are
setting the title of the resource to "/gpfs20/home". The title can be
completly random (as long as it is unique) but it will also implicitly set
the name parameter as long as you don't overwrite it explicitly. The name
parameter determines the mountpoint. So I guess what you really want is

mount { '/chroot/centos5/home':
ensure => mounted,
device => '/gpfs20/home',
fstype => 'none',
options => 'rw,bind',
}

As you can see I omitted the name parameter (the mountpoint) because it is
implicitly set to the resource's title ("/chroot/centos5/home")

-Stefan

cnjohnson

unread,
Jun 22, 2012, 1:01:32 PM6/22/12
to puppet...@googlegroups.com


On Friday, June 22, 2012 11:20:45 AM UTC-5, Stefan Schulte wrote:
So I guess what you really want is

    mount { '/chroot/centos5/home':
      ensure  => mounted,
      device  => '/gpfs20/home',
      fstype  => 'none',
      options => 'rw,bind',
    }

As you can see I omitted the name parameter (the mountpoint) because it is
implicitly set to the resource's title ("/chroot/centos5/home")

-Stefan

Thanks!

Charles 
Reply all
Reply to author
Forward
0 new messages