Puppet pass a fact into a double-quoted line of code in an ERB file
I'm sure the answer to this is straightforward, but I can't find out how to do this. I have a line in my erb template file that needs to write exactly as-is into a server's config file (for OpenVPN):
push "dhcp-option DNS 220.127.116.11"
I need to change this so that the ip address gets looked up from the facter listing on the server, rather than having it hard-coded, as this conf file needs to be used on different servers now. The fact holding this ip address is "ipaddress_tun0". I've tried putting it into my line, thus:
push "dhcp-option DNS <%= @ipaddress_tun0 %>"
.. but the fact doesn't get interpolated properly, presumably because of the double quotes. Unfortunately the double quotes are needed as a literal part of the line in the conf file, so they have to be there (single quotes don't work). Can anyone advise how I can get this line to look up and insert the value of ipaddress_tun0, please?