Gather just the necessary facts (#5955)

* Gather just the necessary facts

* Move fact gathering to separate playbook.
This commit is contained in:
Lovro Seder
2020-04-18 01:23:36 +02:00
committed by GitHub
parent 7930f6fa0a
commit 27a268df33
7 changed files with 63 additions and 4 deletions

View File

@@ -44,8 +44,12 @@
- { role: kubespray-defaults }
- { role: bootstrap-os, tags: bootstrap-os}
- name: Gather facts
import_playbook: facts.yml
- name: Download images to ansible host cache via first kube-master node
hosts: kube-master[0]
gather_facts: False
any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
roles:
- { role: kubespray-defaults, when: "not skip_downloads and download_run_once and not download_localhost"}
@@ -55,6 +59,7 @@
- name: Prepare nodes for upgrade
hosts: k8s-cluster:etcd:calico-rr
gather_facts: False
any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
roles:
- { role: kubespray-defaults }
@@ -64,6 +69,7 @@
- name: Upgrade container engine on non-cluster nodes
hosts: etcd:calico-rr:!k8s-cluster
gather_facts: False
any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
serial: "{{ serial | default('20%') }}"
roles:
@@ -72,6 +78,7 @@
environment: "{{ proxy_env }}"
- hosts: etcd
gather_facts: False
any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
roles:
- { role: kubespray-defaults }
@@ -83,6 +90,7 @@
when: not etcd_kubeadm_enabled | default(false)
- hosts: k8s-cluster
gather_facts: False
any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
roles:
- { role: kubespray-defaults }
@@ -94,6 +102,7 @@
when: not etcd_kubeadm_enabled | default(false)
- name: Handle upgrades to master components first to maintain backwards compat.
gather_facts: False
hosts: kube-master
any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
serial: 1
@@ -112,6 +121,7 @@
- name: Upgrade calico and external cloud provider on all masters and nodes
hosts: kube-master:kube-node
gather_facts: False
any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
serial: "{{ serial | default('20%') }}"
roles:
@@ -123,6 +133,7 @@
- name: Finally handle worker upgrades, based on given batch size
hosts: kube-node:!kube-master
gather_facts: False
any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
serial: "{{ serial | default('20%') }}"
roles:
@@ -136,6 +147,7 @@
environment: "{{ proxy_env }}"
- hosts: kube-master[0]
gather_facts: False
any_errors_fatal: true
roles:
- { role: kubespray-defaults }
@@ -143,6 +155,7 @@
- { role: win_nodes/kubernetes_patch, tags: ["master", "win_nodes"] }
- hosts: calico-rr
gather_facts: False
any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
roles:
- { role: kubespray-defaults }
@@ -150,6 +163,7 @@
environment: "{{ proxy_env }}"
- hosts: kube-master
gather_facts: False
any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
roles:
- { role: kubespray-defaults }
@@ -157,6 +171,7 @@
environment: "{{ proxy_env }}"
- hosts: k8s-cluster
gather_facts: False
any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
roles:
- { role: kubespray-defaults }