ultrabirb-cluster/ansible/tasks/fix-dns-resolution.yaml

38 lines
819 B
YAML
Raw Permalink Normal View History

2021-11-09 01:35:02 +01:00
- name: "disable systemd-resolved"
systemd:
name: systemd-resolved
state: stopped
enabled: no
masked: yes
- name: check if resolvconf linked
stat:
path: /etc/resolv.conf
2021-11-09 01:44:55 +01:00
register: link
2021-11-09 01:35:02 +01:00
- name: remove symlink
file:
path: /etc/resolv.conf
state: absent
when: link.stat.islnk is defined and link.stat.islnk
- name: set very good resolv config
copy:
src: resolv.conf
dest: /etc/resolv.conf
mode: 644
2021-11-10 00:37:26 +01:00
owner: root
2021-11-10 00:50:55 +01:00
- name: check if rules file exists
stat:
path: /etc/kubernetes/kubelet-config.yaml
register: kubelet_config
2021-11-10 00:37:26 +01:00
- name: fix kubelet wrong resolver
lineinfile:
path: /etc/kubernetes/kubelet-config.yaml
regexp: '^resolvConf:'
line: 'resolvConf: "/etc/resolv.conf"'
notify: restartkubelet
2021-11-10 00:50:55 +01:00
when: kubelet_config.stat.exists == True