|
|
@ -28,16 +28,6 @@ |
|
|
|
- '^127\.0\.0\.1(\s+){{ inventory_hostname }}.*' |
|
|
|
- '^::1(\s+){{ inventory_hostname }}.*' |
|
|
|
|
|
|
|
- name: install dnsmasq and bindr9utils |
|
|
|
apt: |
|
|
|
name: "{{ item }}" |
|
|
|
state: present |
|
|
|
update_cache: yes |
|
|
|
with_items: |
|
|
|
- dnsmasq |
|
|
|
- bind9utils |
|
|
|
when: inventory_hostname in groups['kube-master'] |
|
|
|
|
|
|
|
- name: ensure dnsmasq.d directory exists |
|
|
|
file: |
|
|
|
path: /etc/dnsmasq.d |
|
|
@ -50,15 +40,17 @@ |
|
|
|
dest: /etc/dnsmasq.d/01-kube-dns.conf |
|
|
|
mode: 755 |
|
|
|
backup: yes |
|
|
|
notify: |
|
|
|
- restart dnsmasq |
|
|
|
when: inventory_hostname in groups['kube-master'] |
|
|
|
|
|
|
|
- name: enable dnsmasq |
|
|
|
service: |
|
|
|
name: dnsmasq |
|
|
|
state: started |
|
|
|
enabled: yes |
|
|
|
- name: create dnsmasq pod template |
|
|
|
template: src=dnsmasq-pod.yml dest=/etc/kubernetes/manifests/dnsmasq-pod.manifest |
|
|
|
when: inventory_hostname in groups['kube-master'] |
|
|
|
|
|
|
|
- name: Check for dnsmasq port |
|
|
|
wait_for: |
|
|
|
port: 53 |
|
|
|
delay: 5 |
|
|
|
timeout: 100 |
|
|
|
when: inventory_hostname in groups['kube-master'] |
|
|
|
|
|
|
|
- name: update resolv.conf with new DNS setup |
|
|
|