Is there a better way of handling double quotes hiera to yaml
I am using a hiera to keep environment/host specific configuration away from code. For generating configuration file - yaml I bump into following scenario:
Hieara config file:
elasticsearch::discovery_unicast_hosts: [ "HOSP-BD-02", "HOSP-BD-03", "HOSP-BD-04" ]
In generate yaml config appears:
and trouble is missing double quotes around every single item in the array. I did following processing of the array before inserting to erb template:
$discovery_unicast_hosts_joined = join($elasticsearch::discovery_unicast_hosts, ",")
If I insert array directly
quotes are there but missing comas. One simple and nasty stolution would be escape " in hieara what I am trying to avoid because it breaks consistency and is error prone.
elasticsearch::discovery_unicast_hosts: [ "\"HOSP-BD-02\"", "\"HOSP-BD-03\"", "\"HOSP-BD-04\"" ]
Is there a better way to solve this?