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
This commit is contained in:
James Slagle 2019-12-04 15:32:00 -05:00
parent e880fa6e11
commit 5c06ffdcd5
2 changed files with 4 additions and 4 deletions

View File

@ -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) %}

View File

@ -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 }}