Move localhost_address to net_ip_map hieradata

all_nodes is meant to be for hieradata that is the same across all
nodes, while localhost_address could possibly be node specific. This
change moves it from all_nodes to net_ip_map.

This will allow rendering the all_nodes template once and then just
copying it into place, which will be a significant performance
improvement.

Change-Id: Ie3b5f242bc2afce9d395e29db498b3516f8bcc3c
changes/63/697363/4
James Slagle 3 years ago
parent e880fa6e11
commit 5c06ffdcd5
  1. 4
      tripleo_ansible/roles/tripleo-hieradata/templates/all_nodes.j2
  2. 4
      tripleo_ansible/roles/tripleo-hieradata/templates/net_ip_map.j2

@ -55,10 +55,6 @@
{% set _ = all_nodes.__setitem__('ovn_dbs_vip', (net_vip_map.ovn_dbs)) %}
{% endif %}
{% endif %}
{% if hieradata_localhost_address is undefined %}
{% set hieradata_localhost_address = ('ipv6' in (ansible_lo | default({}))) | ternary('localhost', '127.0.0.1') %}
{% endif %}
{% set _ = all_nodes.__setitem__('localhost_address', hieradata_localhost_address) %}
{% set _ = all_nodes.__setitem__('deploy_identifier', deploy_identifier) %}
{% set _ = all_nodes.__setitem__('stack_action', stack_action) %}
{% set _ = all_nodes.__setitem__('stack_update_type', stack_update_type) %}

@ -20,5 +20,9 @@
{% endif %}
{% endfor %}
{% endif %}
{% if hieradata_localhost_address is undefined %}
{% set hieradata_localhost_address = ('ipv6' in (ansible_lo | default({}))) | ternary('localhost', '127.0.0.1') %}
{% endif %}
{% set _ = net_ip_map.__setitem__('localhost_address', hieradata_localhost_address) %}
{# RENDER #}
{{ net_ip_map | to_nice_json }}

Loading…
Cancel
Save