- name: 准备dnscache的部署文件 template: src=dns/nodelocaldns-ipvs.yaml.j2 dest={{ cluster_dir }}/yml/nodelocaldns.yaml when: "PROXY_MODE == 'ipvs'" run_once: true connection: local - name: 准备dnscache的部署文件 template: src=dns/nodelocaldns-iptables.yaml.j2 dest={{ cluster_dir }}/yml/nodelocaldns.yaml when: "PROXY_MODE == 'iptables'" run_once: true connection: local - name: 创建dnscache部署 shell: "{{ base_dir }}/bin/kubectl apply -f {{ cluster_dir }}/yml/nodelocaldns.yaml" run_once: true connection: local