Parallelize test_networking.sh script

The script will run locally on each host and only report its
own status. Ansible will track success on a per-node basis.
Postinstall section now applies to all nodes that run Kubernetes
services.

Change-Id: I84c526f44a3cdb9422ee720a4c148201bdc8b90d
This commit is contained in:
Matthew Mosesohn 2016-09-15 12:59:24 +03:00
parent 6b0b3fd383
commit 45a1b9c27b
2 changed files with 8 additions and 1 deletions

View File

@ -1,5 +1,5 @@
---
- hosts: kube-master[0]
- hosts: k8s-cluster
roles:
- { role: postinstall, tags: postinstall }

View File

@ -16,6 +16,9 @@
- name: Test networking connectivity
shell: "bash {{ bin_dir }}/test_networking.sh"
environment:
ADMIN_IP: "{{ hostvars[groups['kube-master'][0]]['ip'] | default(hostvars[groups['kube-master'][0]]['ansible_default_ipv4']['address']) }}"
SLAVE_IPS: "{{ ip }}"
changed_when: false
become: no
@ -27,7 +30,11 @@
group: root
mode: 0644
register: dashboard
delegate_to: "{{groups['kube-master'][0]}}"
run_once: true
- name: Create Kubernetes dashboard
command: "{{ bin_dir }}/kubectl create -f /etc/kubernetes/kubernetes-dashboard.yml"
when: dashboard.changed
delegate_to: "{{groups['kube-master'][0]}}"
run_once: true