Hi,

I'm trying to retrieve a configuration value from a local file in a
custom fact. I'm having some problems with this though. I hope,
someone can point me to the right direction.

My configuration file looks something like this:
cat /tmp/example.properties
my.application.wsdl.url=http://myserver.mydomain.de:8080/path/to/
application?wsdl

My custom fact would have a line like this:
myserver=%x{cat  /tmp/example.properties| sed -n "s|
my.application.*http://\(.*\):.*|\1|p" }.chomp

Unfortunatley this doesn't work. The custom fact returns an undefined
variable. It seems to me, that the cause is a combination of the use
of parenthesis and/or backslashes and the %x operator, because

irb(main):001:0> s = system 'cat /tmp/example.properties | sed -n "s|
my.application.*http://\(.*\):.*|\1|p"'
myserver.mydomain.de
=> true
is working.

irb(main):006:0> s = %x[ cat /tmp/example.properties | sed -n "s|
application|\1|p" ]
=> "my.\001.wsdl.url=http://myserver.mydomain.de:8080/path/to/
application?wsdl\n"
is working (at least I get a result).

irb(main):004:0> s = %x[ cat /tmp/example.properties | sed -n "s|
my.application.*http://\(.*\):.*|\1|p" ]
=> ""
is not working

I tried removing and doubling the backslashes to no avail.
Does someone have an idea, what I'm doing wrong or what other approach
would be possible?

Thanks in advance, Daniela

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

Reply via email to