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:
parent
6b0b3fd383
commit
45a1b9c27b
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
- hosts: kube-master[0]
|
||||
- hosts: k8s-cluster
|
||||
roles:
|
||||
- { role: postinstall, tags: postinstall }
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue