Browse Source
Merge pull request #11598 from VannTen/cleanup/fact_gathering
Merge pull request #11598 from VannTen/cleanup/fact_gathering
Do not serialize fact gathering for no_proxypull/11681/head
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
16 changed files with 52 additions and 61 deletions
Unified View
Diff Options
-
6docs/ansible/vars.md
-
2roles/etcd/tasks/join_etcd-events_member.yml
-
2roles/etcd/tasks/join_etcd_member.yml
-
2roles/etcd/templates/openssl.conf.j2
-
2roles/kubernetes/control-plane/tasks/kubeadm-upgrade.yml
-
2roles/kubernetes/control-plane/templates/kubeadm-config.v1beta3.yaml.j2
-
4roles/kubernetes/node/defaults/main.yml
-
2roles/kubernetes/node/templates/loadbalancer/haproxy.cfg.j2
-
2roles/kubernetes/node/templates/loadbalancer/nginx.conf.j2
-
15roles/kubernetes/preinstall/tasks/0040-verify-settings.yml
-
16roles/kubespray-defaults/defaults/main/main.yml
-
35roles/kubespray-defaults/tasks/fallback_ips.yml
-
17roles/kubespray-defaults/tasks/main.yaml
-
2roles/kubespray-defaults/tasks/no_proxy.yml
-
2roles/network_plugin/flannel/defaults/main.yml
-
2roles/network_plugin/kube-ovn/defaults/main.yml
@ -1,35 +0,0 @@ |
|||||
--- |
|
||||
# Set 127.0.0.1 as fallback IP if we do not have host facts for host |
|
||||
# ansible_default_ipv4 isn't what you think. |
|
||||
# Thanks https://medium.com/opsops/ansible-default-ipv4-is-not-what-you-think-edb8ab154b10 |
|
||||
|
|
||||
- name: Gather ansible_default_ipv4 from all hosts or specific hosts |
|
||||
setup: |
|
||||
gather_subset: '!all,network' |
|
||||
filter: "ansible_default_ipv4" |
|
||||
delegate_to: "{{ item }}" |
|
||||
delegate_facts: true |
|
||||
when: hostvars[item].ansible_default_ipv4 is not defined |
|
||||
loop: "{{ (ansible_play_hosts_all + [groups['kube_control_plane'][0]]) | unique if ansible_limit is defined else (groups['k8s_cluster'] | default([]) + groups['etcd'] | default([]) + groups['calico_rr'] | default([])) | unique }}" |
|
||||
run_once: true |
|
||||
ignore_unreachable: true |
|
||||
tags: always |
|
||||
|
|
||||
- name: Create fallback_ips_base |
|
||||
set_fact: |
|
||||
fallback_ips_base: | |
|
||||
--- |
|
||||
{% set search_hosts = (ansible_play_hosts_all + [groups['kube_control_plane'][0]]) | unique if ansible_limit is defined else (groups['k8s_cluster'] | default([]) + groups['etcd'] | default([]) + groups['calico_rr'] | default([])) | unique %} |
|
||||
{% for item in search_hosts %} |
|
||||
{% set found = hostvars[item].get('ansible_default_ipv4') %} |
|
||||
{{ item }}: "{{ found.get('address', '127.0.0.1') }}" |
|
||||
{% endfor %} |
|
||||
delegate_to: localhost |
|
||||
connection: local |
|
||||
delegate_facts: true |
|
||||
become: false |
|
||||
run_once: true |
|
||||
|
|
||||
- name: Set fallback_ips |
|
||||
set_fact: |
|
||||
fallback_ips: "{{ hostvars.localhost.fallback_ips_base | from_yaml }}" |
|
Write
Preview
Loading…
Cancel
Save