You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
1.4 KiB

  1. ---
  2. - name: Kubernetes Apps | Lay Down CoreDNS Template
  3. template:
  4. src: "{{ item.file }}.j2"
  5. dest: "{{ kube_config_dir }}/{{ item.file }}"
  6. with_items:
  7. - { name: coredns, file: coredns-config.yml, type: configmap }
  8. - { name: coredns, file: coredns-sa.yml, type: sa }
  9. - { name: coredns, file: coredns-deployment.yml, type: deployment }
  10. - { name: coredns, file: coredns-svc.yml, type: svc }
  11. - { name: coredns, file: coredns-clusterrole.yml, type: clusterrole }
  12. - { name: coredns, file: coredns-clusterrolebinding.yml, type: clusterrolebinding }
  13. register: coredns_manifests
  14. vars:
  15. clusterIP: "{{ skydns_server }}"
  16. when:
  17. - dns_mode in ['coredns', 'coredns_dual']
  18. - inventory_hostname == groups['kube-master'][0]
  19. tags:
  20. - coredns
  21. - name: Kubernetes Apps | Lay Down Secondary CoreDNS Template
  22. template:
  23. src: "{{ item.src }}.j2"
  24. dest: "{{ kube_config_dir }}/{{ item.file }}"
  25. with_items:
  26. - { name: coredns, src: coredns-deployment.yml, file: coredns-deployment-secondary.yml, type: deployment }
  27. - { name: coredns, src: coredns-svc.yml, file: coredns-svc-secondary.yml, type: svc }
  28. register: coredns_secondary_manifests
  29. vars:
  30. clusterIP: "{{ skydns_server_secondary }}"
  31. coredns_ordinal_suffix: "-secondary"
  32. when:
  33. - dns_mode == 'coredns_dual'
  34. - inventory_hostname == groups['kube-master'][0]
  35. tags:
  36. - coredns