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.

38 lines
1.5 KiB

  1. ---
  2. - name: Cert Manager | Create addon dir
  3. file:
  4. path: "{{ kube_config_dir }}/addons/cert_manager"
  5. state: directory
  6. owner: root
  7. group: root
  8. mode: 0755
  9. - name: Cert Manager | Create manifests
  10. template:
  11. src: "{{ item.file }}.j2"
  12. dest: "{{ kube_config_dir }}/addons/cert_manager/{{ item.file }}"
  13. with_items:
  14. - { name: cert-manager-ns, file: cert-manager-ns.yml, type: ns }
  15. - { name: cert-manager-sa, file: cert-manager-sa.yml, type: sa }
  16. - { name: cert-manager-clusterrole, file: cert-manager-clusterrole.yml, type: clusterrole }
  17. - { name: cert-manager-clusterrolebinding, file: cert-manager-clusterrolebinding.yml, type: clusterrolebinding }
  18. - { name: cert-manager-issuer-crd, file: cert-manager-issuer-crd.yml, type: crd }
  19. - { name: cert-manager-clusterissuer-crd, file: cert-manager-clusterissuer-crd.yml, type: crd }
  20. - { name: cert-manager-certificate-crd, file: cert-manager-certificate-crd.yml, type: crd }
  21. - { name: cert-manager-deploy, file: cert-manager-deploy.yml, type: deploy }
  22. register: cert_manager_manifests
  23. when:
  24. - inventory_hostname == groups['kube-master'][0]
  25. - name: Cert Manager | Apply manifests
  26. kube:
  27. name: "{{ item.item.name }}"
  28. namespace: "{{ cert_manager_namespace }}"
  29. kubectl: "{{ bin_dir }}/kubectl"
  30. resource: "{{ item.item.type }}"
  31. filename: "{{ kube_config_dir }}/addons/cert_manager/{{ item.item.file }}"
  32. state: "latest"
  33. with_items: "{{ cert_manager_manifests.results }}"
  34. when:
  35. - inventory_hostname == groups['kube-master'][0]