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.

32 lines
1.1 KiB

  1. ---
  2. - name: Backup old configuration files
  3. copy:
  4. src: "{{ kube_config_dir }}/{{ item.src }}"
  5. dest: "{{ kube_config_dir }}/{{ item.dest }}"
  6. remote_src: yes
  7. with_items:
  8. - {src: admin.conf, dest: admin.conf.old}
  9. - {src: kubelet.conf, dest: kubelet.conf.old}
  10. - {src: controller-manager.conf, dest: controller-manager.conf.old}
  11. - {src: scheduler.conf, dest: scheduler.conf.old}
  12. ignore_errors: yes
  13. - name: Remove old configuration files
  14. file:
  15. path: "{{ kube_config_dir }}/{{ item }}"
  16. state: absent
  17. with_items:
  18. - admin.conf
  19. - kubelet.conf
  20. - controller-manager.conf
  21. - scheduler.conf
  22. - name: Generate new configuration files
  23. command: "{{ bin_dir }}/kubeadm init phase kubeconfig all --config={{ kube_config_dir }}/kubeadm-config.yaml"
  24. when: kubeadm_version is version('v1.13.0', '>=')
  25. ignore_errors: yes
  26. - name: Generate new configuration files
  27. command: "{{ bin_dir }}/kubeadm alpha phase kubeconfig all --config={{ kube_config_dir }}/kubeadm-config.yaml"
  28. when: kubeadm_version is version('v1.13.0', '<')
  29. ignore_errors: yes