diff --git a/tasks/master-setup.yml b/tasks/master-setup.yml index b9d1994..2986ffc 100644 --- a/tasks/master-setup.yml +++ b/tasks/master-setup.yml @@ -45,6 +45,22 @@ changed_when: "'created' in calico_result.stdout" when: kubernetes_pod_network.cni == 'calico' +# LINT-ERROR +- name: "Get K8s version" + shell: | + set -o pipefail + kubectl version | base64 | tr -d '\n' + register: k8_version + when: kubernetes_pod_network.cni == 'weave' + +- name: Configure Weave networking. + command: "{{ item }}" + with_items: + - "kubectl apply -f https://cloud.weave.works/k8s/net?k8s-version={{ k8_version.stdout_lines[0] }}" + register: weave_result + changed_when: "'created' in weave_result.stdout" + when: kubernetes_pod_network.cni == 'weave' + # TODO: Check if taint exists with something like `kubectl describe nodes` # instead of using kubernetes_init_stat.stat.exists check. - name: Allow pods on master node (if configured).