Fix idempotence for web ui enablement.

This commit is contained in:
Jeff Geerling 2018-05-09 14:51:36 -05:00
parent 751369584d
commit 9d0299daf8
2 changed files with 10 additions and 2 deletions

View File

@ -30,7 +30,7 @@ TODO.
TODO. TODO.
kubernetes_enable_web_ui: True kubernetes_enable_web_ui: False
TODO. TODO.

View File

@ -75,6 +75,14 @@
- kubernetes_allow_pods_on_master - kubernetes_allow_pods_on_master
- kubernetes_init_stat.stat.exists == False - kubernetes_init_stat.stat.exists == False
- name: Check if Kubernetes Dashboard UI service already exists.
shell: kubectl get services --namespace kube-system | grep -q kubernetes-dashboard
changed_when: False
register: kubernetes_dashboard_service
when: kubernetes_enable_web_ui
- name: Enable the Kubernetes Web Dashboard UI (if configured). - name: Enable the Kubernetes Web Dashboard UI (if configured).
command: "kubectl create -f https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml" command: "kubectl create -f https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml"
when: kubernetes_enable_web_ui when:
- kubernetes_enable_web_ui
- kubernetes_dashboard_service is failed