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.

30 lines
1.0 KiB

  1. ---
  2. - name: Remove old cloud provider config
  3. hosts: kube_node:kube_control_plane
  4. tasks:
  5. - name: Remove old cloud provider config
  6. file:
  7. path: "{{ item }}"
  8. state: absent
  9. with_items:
  10. - /etc/kubernetes/cloud_config
  11. - name: Migrate intree Cinder PV
  12. hosts: kube_control_plane[0]
  13. tasks:
  14. - name: Include kubespray-default variables
  15. include_vars: ../roles/kubespray-defaults/defaults/main/main.yml
  16. - name: Copy get_cinder_pvs.sh to master
  17. copy:
  18. src: get_cinder_pvs.sh
  19. dest: /tmp
  20. mode: u+rwx
  21. - name: Get PVs provisioned by in-tree cloud provider
  22. command: /tmp/get_cinder_pvs.sh
  23. register: pvs
  24. - name: Remove get_cinder_pvs.sh
  25. file:
  26. path: /tmp/get_cinder_pvs.sh
  27. state: absent
  28. - name: Rewrite the "pv.kubernetes.io/provisioned-by" annotation
  29. command: "{{ bin_dir }}/kubectl annotate --overwrite pv {{ item }} pv.kubernetes.io/provisioned-by=cinder.csi.openstack.org"
  30. loop: "{{ pvs.stdout_lines | list }}"