From 07aa887e99040ec1eaf49232df6722312bd78ed7 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Mon, 23 Mar 2020 10:48:47 -0500 Subject: [PATCH] PR #65 follow-up: Clean up formatting slightly. --- README.md | 6 ++++-- tasks/master-setup.yml | 7 ++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 9b15997..b5d33f7 100644 --- a/README.md +++ b/README.md @@ -59,14 +59,16 @@ Whether to enable the Kubernetes web dashboard UI (only accessible on the master # Flannel CNI. cni: 'flannel' cidr: '10.244.0.0/16' + # # Calico CNI. # cni: 'calico' # cidr: '192.168.0.0/16' + # # Weave CNI. # cni: 'weave' # cidr: '192.168.0.0/16' - -This role currently supports `flannel` (default), `calico` or `weave` for cluster pod networking. Choose one or the other for your cluster; converting between the three is not done automatically and could result in broken networking, and should be done outside of this role. + +This role currently supports `flannel` (default), `calico` or `weave` for cluster pod networking. Choose only one for your cluster; converting between them is not done automatically and could result in broken networking; if you need to switch from one to another, it should be done outside of this role. kubernetes_apiserver_advertise_address: '' kubernetes_version_kubeadm: 'stable-{{ kubernetes_version }}' diff --git a/tasks/master-setup.yml b/tasks/master-setup.yml index ce1d7c5..fd7666d 100644 --- a/tasks/master-setup.yml +++ b/tasks/master-setup.yml @@ -44,15 +44,16 @@ changed_when: "'created' in calico_result.stdout" when: kubernetes_pod_network.cni == 'calico' -- name: "Get K8s version" +- name: Get Kubernetes version for Weave installation. shell: kubectl version | base64 | tr -d '\n' - register: k8_version + changed_when: false + register: kubectl_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] }}" + - "kubectl apply -f https://cloud.weave.works/k8s/net?k8s-version={{ kubectl_version.stdout_lines[0] }}" register: weave_result changed_when: "'created' in weave_result.stdout" when: kubernetes_pod_network.cni == 'weave'