Re: [Puppet Users] Exec resource and environment parameter

2012-10-11 Thread Tom

On 10/10/12 21:52, Felipe Salum wrote:

exec { 'test':
 path= 
'/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',

 environment = [HOME=test, HOME2=test2],
command= echo $HOME  /tmp/key,
user= 'root',
group  = 'root',
   }

Hi.  You need to escape the $ character!

For instance: echo \$HOME  /tmp/key

If you had defined $HOME within your manifest, then that would be the 
value that puppet substituted:


  $HOME = 'HI'
  exec { 'test':
path= 
'/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',

environment = [HOME=test, HOME2=test2],
command = echo $HOME  /tmp/key,
user= 'root',
group   = 'root',
   }


Cheers.  Tom.

--
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] Exec resource and environment parameter

2012-10-10 Thread Felipe Salum
I'm trying to use the environment parameter on Exec but it is not working. 
Any idea what's wrong ?

exec { 'test':
 path= 
'/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
 environment = [HOME=test, HOME2=test2],
command= echo $HOME  /tmp/key,
user= 'root',
group  = 'root',
   }

I'm using Puppet 3.0

Thanks,
Felipe

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/2F-pxT-TA2wJ.
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.