Speed up tasks (#4278)

* fact gathering should run only once per node
* eliminate ansible version check, it is at the beginning of each
  playbook
This commit is contained in:
Gabor Lekeny 2019-02-26 04:56:23 +01:00 committed by Kubernetes Prow Robot
parent c386172be7
commit b4aaa7b908
2 changed files with 3 additions and 8 deletions

View file

@ -35,13 +35,14 @@
any_errors_fatal: "{{ any_errors_fatal | default(true) }}" any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
vars: vars:
ansible_ssh_pipelining: true ansible_ssh_pipelining: true
gather_facts: true gather_facts: false
pre_tasks: pre_tasks:
- name: gather facts from all instances - name: gather facts from all instances
setup: setup:
delegate_to: "{{item}}" delegate_to: "{{item}}"
delegate_facts: True delegate_facts: true
with_items: "{{ groups['k8s-cluster'] + groups['etcd'] + groups['calico-rr']|default([]) }}" with_items: "{{ groups['k8s-cluster'] + groups['etcd'] + groups['calico-rr']|default([]) }}"
run_once: true
- hosts: k8s-cluster:etcd:calico-rr - hosts: k8s-cluster:etcd:calico-rr
any_errors_fatal: "{{ any_errors_fatal | default(true) }}" any_errors_fatal: "{{ any_errors_fatal | default(true) }}"

View file

@ -1,10 +1,4 @@
--- ---
- name: Stop if ansible version is too low
assert:
that:
- ansible_version.full is version('2.3.0', '>=')
run_once: yes
- name: Stop if either kube-master, kube-node or etcd is empty - name: Stop if either kube-master, kube-node or etcd is empty
assert: assert:
that: groups.get('{{ item }}') that: groups.get('{{ item }}')