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.

28 lines
877 B

  1. ---
  2. - name: gets the kubeadm version
  3. command: "{{ bin_dir }}/kubeadm version -o short"
  4. register: kubeadm_output
  5. - name: sets kubeadm api version to v1alpha2
  6. set_fact:
  7. kubeadmConfig_api_version: v1alpha2
  8. when:
  9. - kubeadm_output.stdout is version('v1.11.0', '>=')
  10. - kubeadm_output.stdout is version('v1.12.0', '<')
  11. - name: sets kubeadm api version to v1alpha3
  12. set_fact:
  13. kubeadmConfig_api_version: v1alpha3
  14. when:
  15. - kubeadm_output.stdout is version('v1.12.0', '>=')
  16. - kubeadm_output.stdout is version('v1.13.0', '<')
  17. - name: sets kubeadm api version to v1beta1
  18. set_fact:
  19. kubeadmConfig_api_version: v1beta1
  20. when: kubeadm_output.stdout is version('v1.13.0', '>=')
  21. - name: kubeadm | Create kubeadm config
  22. template:
  23. src: "kubeadm-config.{{ kubeadmConfig_api_version }}.yaml.j2"
  24. dest: "{{ kube_config_dir }}/kubeadm-config.yaml"