[Puppet Users] Re: Environment variable access inside an exec

2009-06-05 Thread lance dillon
You could also use augeas to manage those options.

On Thu, Jun 4, 2009 at 7:12 PM, Mike Renfro  wrote:

>
> On 6/4/2009 5:59 PM, Brandon Whalen wrote:
> > I've spent some time looking at the example recipes and reading the docs
> on
> > a problem, but I'm still stumped. I'm trying to add some options to my
> fstab
> > and am finding some problems. I'm using the environment option to create
> an
> > environment variable MNT_OPTS that I then reference as part of a sed
> call.
> > I'm finding that MNT_OPTS is empty when I reference it. My exact code is
> > below.
>
> Unless you're specifically trying to add options to whatever /home entry
>  already exists, you might want to use the builtin mount type. I know
> you can use it to specify all the mount options, but I'm not sure if you
> can use the '+>' operator to add options to whatever exists.
>
> http://reductivelabs.com/trac/puppet/wiki/TypeReference#mount
>
> --
> Mike Renfro  / R&D Engineer, Center for Manufacturing Research,
> 931 372-3601 / Tennessee Technological University
>
>

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[Puppet Users] Re: Environment variable access inside an exec

2009-06-04 Thread Mike Renfro

On 6/4/2009 5:59 PM, Brandon Whalen wrote:
> I've spent some time looking at the example recipes and reading the docs on
> a problem, but I'm still stumped. I'm trying to add some options to my fstab
> and am finding some problems. I'm using the environment option to create an
> environment variable MNT_OPTS that I then reference as part of a sed call.
> I'm finding that MNT_OPTS is empty when I reference it. My exact code is
> below.

Unless you're specifically trying to add options to whatever /home entry 
  already exists, you might want to use the builtin mount type. I know 
you can use it to specify all the mount options, but I'm not sure if you 
can use the '+>' operator to add options to whatever exists.

http://reductivelabs.com/trac/puppet/wiki/TypeReference#mount

-- 
Mike Renfro  / R&D Engineer, Center for Manufacturing Research,
931 372-3601 / Tennessee Technological University

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[Puppet Users] Re: Environment variable access inside an exec

2009-06-04 Thread RijilV

2009/6/4 Brandon Whalen :
>
> I've spent some time looking at the example recipes and reading the docs on
> a problem, but I'm still stumped. I'm trying to add some options to my fstab
> and am finding some problems. I'm using the environment option to create an
> environment variable MNT_OPTS that I then reference as part of a sed call.
> I'm finding that MNT_OPTS is empty when I reference it. My exact code is
> below.
>
> #nosuid, nodev, and acl on /home
> exec { "sed -i 's/\( \/home.*${MNT_OPTS}\)/\1,nosuid,nodev,acl/'
> /etc/fstab":
>      onlyif => "test `grep ' \/home ' /etc/fstab | grep -c nosuid` -eq 0",
>      environment => "MNT_OPTS=`grep ' \/home ' /etc/fstab | awk '{print
> $4}'`";
> }
>
>
> Could someone tell me what I'm doing wrong and tell me what I need to do to
> fix it or point me at some examples.


Puppet is likely trying to find the value of MNT_OPTS before it hands
it off to the shell.  Give it a a go with escaping it, same with that
$4 in your awk.


.r'

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---