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.

58 lines
1.9 KiB

  1. ---
  2. - name: Registry | Create addon dir
  3. file:
  4. path: "{{ kube_config_dir }}/addons/registry"
  5. state: directory
  6. owner: root
  7. group: root
  8. mode: 0755
  9. - name: Registry | Create manifests
  10. template:
  11. src: "{{ item.file }}.j2"
  12. dest: "{{ kube_config_dir }}/addons/registry/{{ item.file }}"
  13. with_items:
  14. - { name: registry-ns, file: registry-ns.yml, type: ns }
  15. - { name: registry-svc, file: registry-svc.yml, type: svc }
  16. - { name: registry-rs, file: registry-rs.yml, type: rs }
  17. - { name: registry-proxy-ds, file: registry-proxy-ds.yml, type: ds }
  18. register: registry_manifests
  19. when: inventory_hostname == groups['kube-master'][0]
  20. - name: Registry | Apply manifests
  21. kube:
  22. name: "{{ item.item.name }}"
  23. namespace: "{{ registry_namespace }}"
  24. kubectl: "{{ bin_dir }}/kubectl"
  25. resource: "{{ item.item.type }}"
  26. filename: "{{ kube_config_dir }}/addons/registry/{{ item.item.file }}"
  27. state: "latest"
  28. with_items: "{{ registry_manifests.results }}"
  29. when: inventory_hostname == groups['kube-master'][0]
  30. - name: Registry | Create PVC manifests
  31. template:
  32. src: "{{ item.file }}.j2"
  33. dest: "{{ kube_config_dir }}/addons/registry/{{ item.file }}"
  34. with_items:
  35. - { name: registry-pvc, file: registry-pvc.yml, type: pvc }
  36. register: registry_manifests
  37. when:
  38. - registry_storage_class != none
  39. - registry_disk_size != none
  40. - inventory_hostname == groups['kube-master'][0]
  41. - name: Registry | Apply PVC manifests
  42. kube:
  43. name: "{{ item.item.name }}"
  44. namespace: "{{ registry_namespace }}"
  45. kubectl: "{{ bin_dir }}/kubectl"
  46. resource: "{{ item.item.type }}"
  47. filename: "{{ kube_config_dir }}/addons/registry/{{ item.item.file }}"
  48. state: "latest"
  49. with_items: "{{ registry_manifests.results }}"
  50. when:
  51. - registry_storage_class != none
  52. - registry_disk_size != none
  53. - inventory_hostname == groups['kube-master'][0]