On Fri, Feb 10, 2012 at 12:15 PM, Christopher Wood <
christopher_w...@pobox.com> wrote:

> Try the mount type?
>
> http://docs.puppetlabs.com/references/stable/type.html#mount
>
> (Any particular reason for using augeas?)
>
> On Fri, Feb 10, 2012 at 12:10:56PM -0800, Joe wrote:
> > I'm trying to add a mount option using puppet/augeas. Something like:
> >
> > class acl {
> >         augeas { "var_fs_acl":
> >                 context => "/files/etc/fstab",
> >                 changes => ["ins opt after *[file='/var']/
> > opt[last()]",
> >                             "set *[file='/var']/opt[last()] acl"],
> >                 onlyif => "match *[file='/var']/opt[.='acl'] size ==
> > 0"
> >         }
> > }
> >
> > This works if /var is a filesystem, but fails if /var is not. Since I
> > can't have two onlyif clauses, I'm not sure how to say:
> > If /var is a filesystem and
>

I second this recommendation -- if it can be done with mount, then that
will make things cleaner for you.  Also, I would question the assumption
that you can't have multiple onlyif elements.  Most of the time, where you
can pass one thing, you can also pass an array, and that works, so you
might try that.  However, you can do something like this with a define for
example:


class nfsclient {  /// some dependencies I've omitted

 define nfs_mount(
                $device,
                $location = "/nfs/nfsa",
                $fstype,
                $owner,
                $group,
                $mode,
                $options = "soft,intr,noatime"
        ){
        file { "${location}/${name}":
                ensure => directory,
                owner => "${owner}",
                group => "${group}",
                mode => "${mode}",
        }
        mount { "${location}/${name}":
                atboot => true,
                ensure => "mounted",
                device => "${device}",
                fstype => "${fstype}",
                options => "${options}",
                pass => "2",
                require => File["${location}/${name}"],
        }
  }
  nfs_mount { "nfsvol1":
                device => "nfsa.internal.site.com:/nfsvol1",
                fstype => "nfs",
                owner => "root",
                mode => "777",
                options => "soft,intr,noatime",
                subscribe => File['/etc/idmapd.conf'],
  }
}

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to