Hello,
I''m trying to manage a properties file used by a java program with
augeas.
I''m using PE 2.7.1 on a CentOS 5 machine.
Sample content is:
# Sample file /home/acrews/test.properties
session.securityLevel.createSession=10
session.securityLevel.listFiles=10
low.session.timeout=15
# eof
I want to change createSession from 10 to 11.
my puppet code is:
augeas { "test":
lens => "Property.lns",
incl => "/home/acrews/test.properties",
changes => [ "set session.securityLevel.createSession 11" ],
load_path => "/home/acrews/lens",
}
I grabbed the properties lens from
https://raw.github.com/maestrodev/augeas/af585c7e29560306f23938b3ba15aa1104951f7f/lenses/properties.aug
(since that is more robust than the one found on my system) and put it
in /home/acrews/lens.
When I run puppet, it fails to update the file:
debug: Augeas[test](provider=augeas): Opening augeas with root /, lens
path /home/acrews/lens, flags 64
debug: Augeas[test](provider=augeas): Augeas version 0.10.0 is installed
debug: Augeas[test](provider=augeas): Will attempt to save and only
run if files changed
debug: Augeas[test](provider=augeas): sending command ''set''
with
params
["/files/home/acrews/test.properties/session.securityLevel.createSession",
"11"]
debug: Augeas[test](provider=augeas): Closed the augeas connection
err: /Stage[main]//Augeas[test]: Could not evaluate: Save failed with
return code false
Full output is at: http://pastebin.com/pa5MWYGH
I can''t figure out why it is failing. Does anyone have any pointers
on how to make this work?
Thanks
-Adam
--
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+unsubscribe@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.
On 27/02/13 07:28, Adam Crews wrote:> Hello, > > I''m trying to manage a properties file used by a java program with augeas. > I''m using PE 2.7.1 on a CentOS 5 machine. > > Sample content is: > # Sample file /home/acrews/test.properties > session.securityLevel.createSession=10 > session.securityLevel.listFiles=10 > low.session.timeout=15 > # eof > > I want to change createSession from 10 to 11. > > my puppet code is: > > augeas { "test": > lens => "Property.lns",This line doesn''t look correct, it should be Properties.lns to match the module you downloaded. -- 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+unsubscribe@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.
Could it be the user you are running puppet as (puppet apply in this case) does not have the rights required to edit (write) the file? Just a guess, but the errors seem to point in that direction. On Wednesday, February 27, 2013 8:28:57 AM UTC+1, Adam Crews wrote:> > Hello, > > I''m trying to manage a properties file used by a java program with augeas. > I''m using PE 2.7.1 on a CentOS 5 machine. > > Sample content is: > # Sample file /home/acrews/test.properties > session.securityLevel.createSession=10 > session.securityLevel.listFiles=10 > low.session.timeout=15 > # eof > > I want to change createSession from 10 to 11. > > my puppet code is: > > augeas { "test": > lens => "Property.lns", > incl => "/home/acrews/test.properties", > changes => [ "set session.securityLevel.createSession 11" > ], > load_path => "/home/acrews/lens", > } > > I grabbed the properties lens from > > https://raw.github.com/maestrodev/augeas/af585c7e29560306f23938b3ba15aa1104951f7f/lenses/properties.aug > (since that is more robust than the one found on my system) and put it > in /home/acrews/lens. > > When I run puppet, it fails to update the file: > > debug: Augeas[test](provider=augeas): Opening augeas with root /, lens > path /home/acrews/lens, flags 64 > debug: Augeas[test](provider=augeas): Augeas version 0.10.0 is installed > debug: Augeas[test](provider=augeas): Will attempt to save and only > run if files changed > debug: Augeas[test](provider=augeas): sending command ''set'' with > params > ["/files/home/acrews/test.properties/session.securityLevel.createSession", > "11"] > debug: Augeas[test](provider=augeas): Closed the augeas connection > err: /Stage[main]//Augeas[test]: Could not evaluate: Save failed with > return code false > > Full output is at: http://pastebin.com/pa5MWYGH > > I can''t figure out why it is failing. Does anyone have any pointers > on how to make this work? > > Thanks > -Adam >-- 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+unsubscribe@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.
On Wed, Feb 27, 2013 at 1:43 AM, Dominic Cleal <dcleal@redhat.com> wrote:>> >> augeas { "test": >> lens => "Property.lns", > > This line doesn''t look correct, it should be Properties.lns to match the > module you downloaded. >Yep, that was the problem. Thanks for the 2nd set of eye to catch the typo. -Adam -- 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+unsubscribe@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.