Unable to make Packer ignore double curly braces in a template file

I have been using the templatefile function to pass variables to a config template, then echo the content into a file, but I just ran into a problem with Consul config files. I can’t find a way to get Packer to ignore the GetPrivateInterfaces function for bind_addr unless the double curly braces are escaped, but by doing that Consul would fail to parse the config. Is there any solution?


datacenter = \"${datacenter}\"
ca_file = \"/etc/consul.d/consul-agent-ca.pem\"
data_dir = \"/opt/consul\"
client_addr = \"\"
verify_incoming = ${is_server}
verify_outgoing = true
verify_server_hostname = true
performance {
    raft_multiplier = 1
bind_addr = \"\{\{GetPrivateInterfaces | include \"network\" \"${private_network_ip_range}\" | attr \"address\"\}\}\"

Error: function "GetPrivateInterfaces" not defined



   config_content=templatefile("consul-config.tpl", {
       is_server = true

  provisioner "shell"{
     inline = ["echo \"${local.config_content}\" > /etc/consul.d/consul.hcl"]