Re: [Puppet Users] Augeas and defvar --> regexp

2013-02-05 Thread Dominic Cleal
On 01/02/13 10:35, "Schöke, Karsten" wrote:
> Hallo,
> 
>  
> 
> I have a problem to include augeas…
> 
> I will to change a comment to a entry in /etc/default/tmpfs in Debian
> Wheezy.
> 
> The comment is
> 
> #RAMTMP=no
> 
>  
> 
> I try this on augtool und it is running:
> 
> augtool> defvar ramtmpcomment
> /files/etc/default/tmpfs/#comment[.=~regexp('RAMTMP=no')]
> 
> augtool> ins RAMTMP after $ramtmpcomment
> 
> augtool> set /files/etc/default/tmpfs/RAMTMP yes
> 
> augtool> rm $ramtmpcomment
> 
>  
> 
> After I running this the entry is correct.
> 
>  
> 
> But, I try this on puppet:
> 
> augeas {"tmpfs":
> 
>   context => "/files/etc/default/tmpfs",
> 
>  changes => [
> 
>  "defvar ramtmpcomment #comment[.=~regexp('RAMTMP=no')]",
> 
>  "ins RAMTMP after $ramtmpcomment",

You should use single quotes here, or escape the variable name with
\$ramtmpcomment.  Puppet will be interpolating the variable itself
rather than letting Augeas do it.

-- 
Dominic Cleal
Red Hat Engineering

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




[Puppet Users] Augeas and defvar --> regexp

2013-02-01 Thread Schöke, Karsten
Hallo,

 

I have a problem to include augeas...

I will to change a comment to a entry in /etc/default/tmpfs in Debian Wheezy.

The comment is 

#RAMTMP=no

 

I try this on augtool und it is running:

augtool> defvar ramtmpcomment 
/files/etc/default/tmpfs/#comment[.=~regexp('RAMTMP=no')]

augtool> ins RAMTMP after $ramtmpcomment

augtool> set /files/etc/default/tmpfs/RAMTMP yes

augtool> rm $ramtmpcomment

 

After I running this the entry is correct.

 

But, I try this on puppet:

augeas {"tmpfs":

  context => "/files/etc/default/tmpfs",

 changes => [

 "defvar ramtmpcomment #comment[.=~regexp('RAMTMP=no')]",

 "ins RAMTMP after $ramtmpcomment",

 "set RAMTMP yes",

 "rm $ramtmpcomment",

 ],

 }

 

Error: /Stage[main]/Debian/Augeas[tmpfs]: Could not evaluate: Error sending 
command 'ins' with params ["RAMTMP", "after", 
"/files/etc/default/tmpfs/"]/Error sending command 'ins' with params ["RAMTMP", 
"after", "/files/etc/default/tmpfs/"]

 

I believe the variable ramtmpcomment is not set

 

Puppet version 3.0.2 aureas 0.10.0

 

Any ideas?

 

Thx

Karsten

 

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.