tripleo-ansible/tripleo_ansible/roles/tripleo-hieradata/defaults/main.yml
Kevin Carter 6338056938 Add local_address to the default hieradata on all hosts
This change will ensure a local_address is always defined within our
generated hieradata. This change imports existing logic into our config
to ensure that the value of the local_address matches our expected
values. We ensure compatibility with legacy installs by inspecting if a
host has IPv6 enabled on the loopback device. In the event that IPv6 is
enabled, the value of local_address will be set to "localhost" otherwise
it will defined as "127.0.0.1".

Closes-Bug: 1843422
Change-Id: I20e69315bacdded4bc2d5b47e18609f130f8abc5
Signed-off-by: Kevin Carter <kecarter@redhat.com>
2019-09-13 18:23:49 -05:00

59 lines
1.6 KiB
YAML

---
# Copyright 2019 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
# `hieradata_content` can be formatted for all hosts or for specific hosts
# containing potentially different values.
#
# Host specific example:
#
# controller1:
# extraconfig:
# foo: bar
# foo2: bar2
# other_hierafile:
# foo: bar3
# controller2:
# extraconfig:
# foo: bar2
# foo2: bar3
# other_hierafile:
# foo: bar
#
#
# Global format example:
#
# extraconfig:
# foo: bar
# foo2: bar2
# other_hierafile:
# foo: bar3
#
hieradata_template: ""
hieradata_files: []
# jinja2 escape trick for simple {{ and }} strings:
hieradata_variable_start_string: "{{ '{{' }}"
hieradata_variable_end_string: "{{ '}}' }}"
hieradata_per_host: false
hieradata_templates_list:
- bootstrap_node
- all_nodes
- vip_data
# define a local address. If the ipv6 is found to be enable on the
# loopback device the local address will be set to "localhost" otherwise
# the local address will be defined as "127.0.0.1".
hieradata_localhost_address: "{{ ('ipv6' in (ansible_lo | default({}))) | ternary('localhost', '127.0.0.1') }}"