Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I need to set the value for "dc_local_interfaces" to "127.0.0.1;::1", but the semi-colon prevents this.

This is my definition in Puppet:

augeas { "/etc/exim4/update-exim4.conf.conf":
  lens    => "Shellvars.lns",
  incl    => "/etc/exim4/update-exim4.conf.conf",
  changes => "set dc_local_interfaces 127.0.0.1;::1",
}

I tried different ways to set the value (using no apostrophes, using apostrophes, using backslash-escaped apostrophes), but none did work. Things work when I use augtool:

set /files/etc/exim4/update-exim4.conf.conf/dc_local_interfaces "'127.0.0.1;::1'"
share|improve this question
    
As I was writing the question and testing in parallel, I found the answer by myself, but as there is little to find for exim/puppet in general, I decided to post this nevertheless in hope others will find it useful. You have to use apostrophes outside so you can use quotation marks inside to be able to use escaped apostrophes on the inner inside again. Yes. And it actually looks even uglier than it sounds (spaces now work too): changes => 'set dc_local_interfaces "\'127.0.0.1;::1;test 1 2 3\'"', –  Larsen Apr 23 '13 at 11:04
    
I'm kind of not sure update-exim4.conf.conf is a shellvars file… It would probably require its own lens. –  ℝaphink Apr 23 '13 at 11:45
    
Probably, but as I couldn´t find one, I used the shellvars lens. –  Larsen Apr 23 '13 at 12:01
add comment

1 Answer 1

up vote 2 down vote accepted

(after some hours I can now answer this directly instead of using a comment (for better formatting))

As I was writing the question and testing in parallel, I found the answer by myself, but as there is little to find for exim/puppet in general, I decided to post this nevertheless in hope others will find it useful.

You have to use apostrophes outside so you can use quotation marks inside to be able to use escaped apostrophes on the inner inside again. Yes. And it actually looks even uglier than it sounds (spaces now work too):

changes => 'set dc_local_interfaces "\'127.0.0.1;::1;test 1 2 3\'"',
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.