mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-02-28 09:39:12 +03:00
Avoid empty "supersede domain-name-servers" directives for dhclient.conf (#10948)
Fixes https://github.com/kubernetes-sigs/kubespray/issues/10947 This patch aims to be minimal and intentionally: - does not change the generation logic for `supersede_domain` and `supersede_search` - does not change how `nameserverentries` (for NetworkManager) is built It seems like `nameserverentries` in the "Generate nameservers for resolvconf, including cluster DNS" task is built the same way as `dhclient_supersede_nameserver_entries_list`. However, `nameserverentries` in the "Generate nameservers for resolvconf, not including cluster DNS" task (below) is built differently for some reason. It includes `configured_nameservers` as well. Due to these differences, I have refrained from reusing the same building logic (`dhclient_supersede_nameserver_entries_list`) for both. If the `configured_nameservers` addition can be removed or made to apply to dhclient as well, we could potentially build a single list and then generate the `nameserverentries` and `supersede_nameserver` strings from it.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
- name: Configure dhclient to supersede search/domain/nameservers
|
||||
blockinfile:
|
||||
block: |-
|
||||
{% for item in [supersede_domain, supersede_search, supersede_nameserver] -%}
|
||||
{% for item in [supersede_domain, supersede_search, supersede_nameserver] | reject('equalto', '') -%}
|
||||
{{ item }}
|
||||
{% endfor %}
|
||||
path: "{{ dhclientconffile }}"
|
||||
|
||||
Reference in New Issue
Block a user