3117858dcd
* For Debian/RedHat OS families (with NetworkManager/dhclient/resolvconf optionally enabled) prepend /etc/resolv.conf with required nameservers, options, and supersede domain and search domains via the dhclient/resolvconf hooks. * Drop (z)nodnsupdate dhclient hook and re-implement it to complement the resolvconf -u command, which is distro/cloud provider specific. Update docs as well. * Enable network restart to apply and persist changes and simplify handlers to rely on network restart only. This fixes DNS resolve for hostnet K8s pods for Red Hat OS family. Skip network restart for canal/calico plugins, unless https://github.com/projectcalico/felix/issues/1185 fixed. * Replace linefiles line plus with_items to block mode as it's faster. Signed-off-by: Bogdan Dobrelya <bdobrelia@mirantis.com> Co-authored-by: Matthew Mosesohn <mmosesohn@mirantis.com>
17 lines
447 B
Django/Jinja
17 lines
447 B
Django/Jinja
#!/bin/sh
|
|
#
|
|
# Prepend resolver options to /etc/resolv.conf after dhclient`
|
|
# regenerates the file. See man (5) resolver for more details.
|
|
#
|
|
zdnsupdate_config() {
|
|
if [ -n "$new_domain_search" -o -n "$new_domain_name_servers" ]; then
|
|
RESOLV_CONF=$(cat /etc/resolv.conf)
|
|
OPTIONS="options timeout:2\noptions attempts:2\noptions ndots:{{ ndots }}"
|
|
|
|
echo -e "$RESOLV_CONF\n$OPTIONS" > /etc/resolv.conf
|
|
fi
|
|
}
|
|
|
|
zdnsupdate_restore() {
|
|
:
|
|
}
|