mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-06-04 14:38:06 -02:30
roles: rely on configured defaults (#13249)
Signed-off-by: Zakhar Dvurechensky <72825626+Zakharden@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
03ae25e410
commit
9049703ce0
@@ -2,7 +2,7 @@
|
|||||||
- name: Download | Prepare working directories and variables
|
- name: Download | Prepare working directories and variables
|
||||||
import_tasks: prep_download.yml
|
import_tasks: prep_download.yml
|
||||||
when:
|
when:
|
||||||
- not skip_downloads | default(false)
|
- not skip_downloads
|
||||||
tags:
|
tags:
|
||||||
- download
|
- download
|
||||||
- upload
|
- upload
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
- name: Download | Get kubeadm binary and list of required images
|
- name: Download | Get kubeadm binary and list of required images
|
||||||
include_tasks: prep_kubeadm_images.yml
|
include_tasks: prep_kubeadm_images.yml
|
||||||
when:
|
when:
|
||||||
- not skip_downloads | default(false)
|
- not skip_downloads
|
||||||
- ('kube_control_plane' in group_names)
|
- ('kube_control_plane' in group_names)
|
||||||
tags:
|
tags:
|
||||||
- download
|
- download
|
||||||
@@ -23,8 +23,8 @@
|
|||||||
download: "{{ download_defaults | combine(item.value) }}"
|
download: "{{ download_defaults | combine(item.value) }}"
|
||||||
include_file: "download_{% if download.container %}container{% else %}file{% endif %}.yml"
|
include_file: "download_{% if download.container %}container{% else %}file{% endif %}.yml"
|
||||||
when:
|
when:
|
||||||
- not skip_downloads | default(false)
|
- not skip_downloads
|
||||||
- download.enabled
|
- download.enabled
|
||||||
- item.value.enabled
|
- item.value.enabled
|
||||||
- (not (item.value.container | default(false))) or (item.value.container and download_container)
|
- (not download.container) or (download.container and download_container)
|
||||||
- (download_run_once and inventory_hostname == download_delegate) or (group_names | intersect(download.groups) | length)
|
- (download_run_once and inventory_hostname == download_delegate) or (group_names | intersect(download.groups) | length)
|
||||||
|
|||||||
@@ -8,6 +8,9 @@ cloud_resolver: []
|
|||||||
disable_host_nameservers: false
|
disable_host_nameservers: false
|
||||||
# Kubespray sets this to true after clusterDNS is running to apply changes to the host resolv.conf
|
# Kubespray sets this to true after clusterDNS is running to apply changes to the host resolv.conf
|
||||||
dns_late: false
|
dns_late: false
|
||||||
|
# DNS resolver option timeout and retry attempts.
|
||||||
|
dns_timeout: 2
|
||||||
|
dns_attempts: 2
|
||||||
|
|
||||||
# Set to true if your network does not support IPv6
|
# Set to true if your network does not support IPv6
|
||||||
# This may be necessary for pulling Docker images from
|
# This may be necessary for pulling Docker images from
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
{% for item in nameserverentries %}
|
{% for item in nameserverentries %}
|
||||||
nameserver {{ item }}
|
nameserver {{ item }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
options ndots:{{ ndots }} timeout:{{ dns_timeout | default('2') }} attempts:{{ dns_attempts | default('2') }}
|
options ndots:{{ ndots }} timeout:{{ dns_timeout }} attempts:{{ dns_attempts }}
|
||||||
state: present
|
state: present
|
||||||
insertbefore: BOF
|
insertbefore: BOF
|
||||||
create: true
|
create: true
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
path: /etc/NetworkManager/conf.d/dns.conf
|
path: /etc/NetworkManager/conf.d/dns.conf
|
||||||
section: global-dns
|
section: global-dns
|
||||||
option: options
|
option: options
|
||||||
value: "ndots:{{ ndots }},timeout:{{ dns_timeout | default('2') }},attempts:{{ dns_attempts | default('2') }}"
|
value: "ndots:{{ ndots }},timeout:{{ dns_timeout }},attempts:{{ dns_attempts }}"
|
||||||
mode: '0600'
|
mode: '0600'
|
||||||
backup: "{{ leave_etc_backup_files }}"
|
backup: "{{ leave_etc_backup_files }}"
|
||||||
notify: Preinstall | update resolvconf for networkmanager
|
notify: Preinstall | update resolvconf for networkmanager
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
if [ $reason = "BOUND" ]; then
|
if [ $reason = "BOUND" ]; then
|
||||||
if [ -n "$new_domain_search" -o -n "$new_domain_name_servers" ]; then
|
if [ -n "$new_domain_search" -o -n "$new_domain_name_servers" ]; then
|
||||||
RESOLV_CONF=$(cat /etc/resolv.conf | sed -r '/^options (timeout|attempts|ndots).*$/d')
|
RESOLV_CONF=$(cat /etc/resolv.conf | sed -r '/^options (timeout|attempts|ndots).*$/d')
|
||||||
OPTIONS="options timeout:{{ dns_timeout|default('2') }} attempts:{{ dns_attempts|default('2') }} ndots:{{ ndots }}"
|
OPTIONS="options timeout:{{ dns_timeout }} attempts:{{ dns_attempts }} ndots:{{ ndots }}"
|
||||||
|
|
||||||
printf "%b\n" "$RESOLV_CONF\n$OPTIONS" > /etc/resolv.conf
|
printf "%b\n" "$RESOLV_CONF\n$OPTIONS" > /etc/resolv.conf
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
zdnsupdate_config() {
|
zdnsupdate_config() {
|
||||||
if [ -n "$new_domain_search" -o -n "$new_domain_name_servers" ]; then
|
if [ -n "$new_domain_search" -o -n "$new_domain_name_servers" ]; then
|
||||||
RESOLV_CONF=$(cat /etc/resolv.conf | sed -r '/^options (timeout|attempts|ndots).*$/d')
|
RESOLV_CONF=$(cat /etc/resolv.conf | sed -r '/^options (timeout|attempts|ndots).*$/d')
|
||||||
OPTIONS="options timeout:{{ dns_timeout|default('2') }} attempts:{{ dns_attempts|default('2') }} ndots:{{ ndots }}"
|
OPTIONS="options timeout:{{ dns_timeout }} attempts:{{ dns_attempts }} ndots:{{ ndots }}"
|
||||||
|
|
||||||
echo -e "$RESOLV_CONF\n$OPTIONS" > /etc/resolv.conf
|
echo -e "$RESOLV_CONF\n$OPTIONS" > /etc/resolv.conf
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user