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.

42 lines
1.4 KiB

  1. ---
  2. - name: Local Volume Provisioner | Ensure base dir is created on all hosts
  3. file:
  4. path: "{{ local_volume_base_dir }}"
  5. ensure: directory
  6. owner: root
  7. group: root
  8. mode: 0700
  9. delegate_to: "{{ item }}"
  10. with_items: "{{ groups['k8s-cluster'] }}"
  11. failed_when: false
  12. - name: Local Volume Provisioner | Create addon dir
  13. file:
  14. path: "{{ kube_config_dir }}/addons/local_volume_provisioner"
  15. owner: root
  16. group: root
  17. mode: 0755
  18. recurse: true
  19. - name: Local Volume Provisioner | Create manifests
  20. template:
  21. src: "{{item.file}}.j2"
  22. dest: "{{kube_config_dir}}/addons/local_volume_provisioner/{{item.file}}"
  23. with_items:
  24. - {name: local-storage-provisioner-pv-binding, file: provisioner-admin-account.yml, type: clusterrolebinding}
  25. - {name: local-volume-config, file: volume-config.yml, type: configmap}
  26. - {name: local-volume-provisioner, file: provisioner-ds.yml, type: daemonset}
  27. register: local_volume_manifests
  28. when: inventory_hostname == groups['kube-master'][0]
  29. - name: Local Volume Provisioner | Apply manifests
  30. kube:
  31. name: "{{item.item.name}}"
  32. namespace: "{{ system_namespace }}"
  33. kubectl: "{{bin_dir}}/kubectl"
  34. resource: "{{item.item.type}}"
  35. filename: "{{kube_config_dir}}/addons/local_volume_provisioner/{{item.item.file}}"
  36. state: "latest"
  37. with_items: "{{ local_volume_manifests.results }}"
  38. when: inventory_hostname == groups['kube-master'][0]