Setting quotes using augeas type

85 views
Skip to first unread message

Kenton Brede

unread,
Apr 30, 2014, 5:21:47 PM4/30/14
to puppet...@googlegroups.com
I'm using the phpvars lens for a cacti file, trying to set the password.

The file entry should look like:
$database_password = "testpass";

I can successfully set and save the password with quotes, while using augtool:
augtool> set /files/usr/share/cacti/include/config.php/$database_password "\"testpass\""

But when using the augeas type with the following:
changes => 'set \$database_password "\"test\""',

The file entry looks like:
$database_password = \"test\";

I've tried a bunch of escape iterations and quoting options.  So far I've not been able to get this to work properly.

Is there some way I can get this to print the variable with quotes, using puppet/augeas?
Thanks,

--
Kent Brede




zerozer...@gmail.com

unread,
May 6, 2014, 5:52:16 AM5/6/14
to puppet...@googlegroups.com
On Wednesday, April 30, 2014 11:21:47 PM UTC+2, kbrede wrote:

But when using the augeas type with the following:
changes => 'set \$database_password "\"test\""',

The file entry looks like:
$database_password = \"test\";

Try this (pay attention to what is a single quote and what is a double!):

changes => 'set \$database_password \'"test"\'',

Marco

Kenton Brede

unread,
May 6, 2014, 10:37:06 AM5/6/14
to puppet...@googlegroups.com
That's one combination I hadn't tried but it works! 
Thanks,
Kent


--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/f1b5d685-0549-4660-b098-25af0b52441a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Kent Brede




Reply all
Reply to author
Forward
0 new messages