Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Local variable in .ERB file works during first run but won't update if list value is changed on consecutive runs

Hi all,

New here so forgive me if I'm asking something that has been asked. I looked around and could not find any information on it specifically.

I'm building out an elasticsearch test cluster. When I do the initial run, the elasticsearch.yml file is updated and the elasticsearch_servers variable joins the list fine, but if I add a server to that list, on consecutive runs, they are not added to the file.

I'm also using this list to generate firewall rules so it's used in multiple places.

Org is currently stuck on puppet 3 so no EPP for us :(

Below is the example ERB.

<%
# List of elasticsearch servers.
$elasticsearch_servers = [
  'es-cluster-dev01.fqdn',
  'es-cluster-dev02.fqdn',
  'es-cluster-dev03.fqdn',
  'es-cluster-dev04.fqdn',
  'es-cluster-dev05.fqdn',
  'es-cluster-dev06.fqdn',
  'es-cluster-dev07.fqdn',
  'es-cluster-dev08.fqdn',
]
-%>

cluster.name: my_cluster
node.name: <%= @fqdn %>
http.host: 0.0.0.0
discovery.zen.ping.unicast.hosts: ["<%= $elasticsearch_servers.join('", "') %>"]
bootstrap.memory_lock: true
discovery.zen.minimum_master_nodes: 2
transport.host: 0.0.0.0
network.host: <%= @ipaddress_ens160 %>