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.7 KiB

  1. ---
  2. - name: CephFS Provisioner | Create addon dir
  3. file:
  4. path: "{{ kube_config_dir }}/addons/cephfs_provisioner"
  5. state: directory
  6. owner: root
  7. group: root
  8. mode: 0755
  9. - name: CephFS Provisioner | Create manifests
  10. template:
  11. src: "{{ item.file }}.j2"
  12. dest: "{{ kube_config_dir }}/addons/cephfs_provisioner/{{ item.file }}"
  13. with_items:
  14. - { name: cephfs-provisioner-ns, file: cephfs-provisioner-ns.yml, type: ns }
  15. - { name: cephfs-provisioner-sa, file: cephfs-provisioner-sa.yml, type: sa }
  16. - { name: cephfs-provisioner-role, file: cephfs-provisioner-role.yml, type: role }
  17. - { name: cephfs-provisioner-rolebinding, file: cephfs-provisioner-rolebinding.yml, type: rolebinding }
  18. - { name: cephfs-provisioner-clusterrole, file: cephfs-provisioner-clusterrole.yml, type: clusterrole }
  19. - { name: cephfs-provisioner-clusterrolebinding, file: cephfs-provisioner-clusterrolebinding.yml, type: clusterrolebinding }
  20. - { name: cephfs-provisioner-rs, file: cephfs-provisioner-rs.yml, type: rs }
  21. - { name: cephfs-provisioner-secret, file: cephfs-provisioner-secret.yml, type: secret }
  22. - { name: cephfs-provisioner-sc, file: cephfs-provisioner-sc.yml, type: sc }
  23. register: cephfs_manifests
  24. when: inventory_hostname == groups['kube-master'][0]
  25. - name: CephFS Provisioner | Apply manifests
  26. kube:
  27. name: "{{ item.item.name }}"
  28. namespace: "{{ cephfs_provisioner_namespace }}"
  29. kubectl: "{{ bin_dir }}/kubectl"
  30. resource: "{{ item.item.type }}"
  31. filename: "{{ kube_config_dir }}/addons/cephfs_provisioner/{{ item.item.file }}"
  32. state: "latest"
  33. with_items: "{{ cephfs_manifests.results }}"
  34. when: inventory_hostname == groups['kube-master'][0]