mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-02-28 01:29:42 +03:00
network_facts: streamline set_fact and setup calls
- invoke setup module only once to gather ipv4 and ipv6 addresses - eliminate remaining use of `fallback_ip` and `fallback_ip6`, allowing us to define (with `set_fact` all the "computed" IPs variable in one go, since there is no longer a dependency between them.
This commit is contained in:
@@ -39,16 +39,12 @@ DNS.{{ counter["dns"] }} = {{ apiserver_loadbalancer_domain_name }}{{ increment(
|
||||
DNS.{{ counter["dns"] }} = {{ etcd_alt_name }}{{ increment(counter, 'dns') }}
|
||||
{% endfor %}
|
||||
{% for host in groups['etcd'] %}
|
||||
{% if hostvars[host]['access_ip'] is defined %}
|
||||
IP.{{ counter["ip"] }} = {{ hostvars[host]['access_ip'] }}{{ increment(counter, 'ip') }}
|
||||
{% endif %}
|
||||
{% if hostvars[host]['access_ip6'] is defined %}
|
||||
IP.{{ counter["ip"] }} = {{ hostvars[host]['access_ip6'] }}{{ increment(counter, 'ip') }}
|
||||
{% endif %}
|
||||
{% if ipv6_stack %}
|
||||
IP.{{ counter["ip"] }} = {{ hostvars[host]['ip6'] | default(hostvars[host]['fallback_ip6']) }}{{ increment(counter, 'ip') }}
|
||||
{% endif %}
|
||||
IP.{{ counter["ip"] }} = {{ hostvars[host]['main_ip'] }}{{ increment(counter, 'ip') }}
|
||||
{% for address in hostvars[host]['main_access_ips'] %}
|
||||
IP.{{ counter["ip"] }} = {{ address }}{{ increment(counter, 'ip') }}
|
||||
{% endfor %}
|
||||
{% for address in hostvars[host]['main_ips'] %}
|
||||
IP.{{ counter["ip"] }} = {{ address }}{{ increment(counter, 'ip') }}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
{% for cert_alt_ip in etcd_cert_alt_ips %}
|
||||
IP.{{ counter["ip"] }} = {{ cert_alt_ip }}{{ increment(counter, 'ip') }}
|
||||
|
||||
Reference in New Issue
Block a user