diff --git a/roles/kubernetes/control-plane/tasks/kubeadm-setup.yml b/roles/kubernetes/control-plane/tasks/kubeadm-setup.yml index 0802c616a..eab2fff1a 100644 --- a/roles/kubernetes/control-plane/tasks/kubeadm-setup.yml +++ b/roles/kubernetes/control-plane/tasks/kubeadm-setup.yml @@ -70,8 +70,15 @@ kubeadm_config_api_fqdn: "{{ apiserver_loadbalancer_domain_name|default('lb-apiserver.kubernetes.local') }}" when: loadbalancer_apiserver is defined -- name: kubeadm | set kubeadm version - import_tasks: kubeadm-version.yml +- name: Set kubeadm api version to v1beta2 + set_fact: + kubeadmConfig_api_version: v1beta2 + +- name: kubeadm | Create kubeadm config + template: + src: "kubeadm-config.{{ kubeadmConfig_api_version }}.yaml.j2" + dest: "{{ kube_config_dir }}/kubeadm-config.yaml" + mode: 0640 - name: kubeadm | Check if apiserver.crt contains all needed SANs command: openssl x509 -noout -in "{{ kube_cert_dir }}/apiserver.crt" -check{{ item|ipaddr|ternary('ip','host') }} "{{ item }}" diff --git a/roles/kubernetes/control-plane/tasks/kubeadm-version.yml b/roles/kubernetes/control-plane/tasks/kubeadm-version.yml deleted file mode 100644 index 603b9389a..000000000 --- a/roles/kubernetes/control-plane/tasks/kubeadm-version.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- -- name: Set kubeadm api version to v1beta2 - set_fact: - kubeadmConfig_api_version: v1beta2 - -- name: kubeadm | Create kubeadm config - template: - src: "kubeadm-config.{{ kubeadmConfig_api_version }}.yaml.j2" - dest: "{{ kube_config_dir }}/kubeadm-config.yaml" - mode: 0640