On Tuesday, July 30, 2013 2:56:59 AM UTC+5:30, haral...@gmail.com wrote:
>
> Hi,
>
> I am trying to define a new type that will insert a new filesystem line 
> into /etc/fstab.
>
> However, no matter what I tried, it will insert a new line each time.
>
> Something like this doesn't work 
>
> augeas { $title:
>                 context => '/files/etc/fstab',
>                 changes => [
>                         "set 01/spec     $fs_dev",
>                         "set 01/file     $fs_mount",
>                         "set 01/vfstype  $fs_type",
>                         "set 01/opt      $fs_opts",
>                         "set 01/dump     $fs_dump",
>                         "set 01/passno   $fs_fsck",
>                         "set 01/#comment $fs_comment",
>                 ],
>                 onlyif => "match */spec[. = $fs_dev] size == 0"    # also 
> tried "match *[spec] not_include $fs_dev"
> }
>
> The "not_include" option doesn't seem to work either ... or maybe I din't 
> know how to use it (very few examples around to say the least)
>
> unless is not available with augeas (I believe)
>
> Any suggestions ?
>
> (I already know about the available fstab module but I want to understand 
> what is going on here)
>
> Many thanks.
>
> Cheers.
>

Hi,
  Here your onlyif condition is the cause of  inserting a new line each 
time.
  you can try this:

  *onlyif => "match*[spec=$fs_dev] size == 0"*
  
 This will match your $fs_dev and will not insert it second time.

Regards,
Sneha More,
NTT DATA GTS,
Pune. (OSS Center) 

  
 

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to