mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2025-12-13 21:34:40 +03:00
Do not use ‘yes/no’ for boolean values (#11472)
Consistent boolean values in ansible playbooks
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
- name: Check Ansible version
|
||||
hosts: all
|
||||
gather_facts: false
|
||||
become: no
|
||||
become: false
|
||||
run_once: true
|
||||
vars:
|
||||
minimal_ansible_version: 2.16.4
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
|
||||
- name: Install bastion ssh config
|
||||
hosts: bastion[0]
|
||||
gather_facts: False
|
||||
gather_facts: false
|
||||
environment: "{{ proxy_disable_env }}"
|
||||
roles:
|
||||
- { role: kubespray-defaults }
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
- name: Prepare for etcd install
|
||||
hosts: k8s_cluster:etcd
|
||||
gather_facts: False
|
||||
gather_facts: false
|
||||
any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
|
||||
environment: "{{ proxy_disable_env }}"
|
||||
roles:
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
- name: Install Kubernetes nodes
|
||||
hosts: k8s_cluster
|
||||
gather_facts: False
|
||||
gather_facts: false
|
||||
any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
|
||||
environment: "{{ proxy_disable_env }}"
|
||||
roles:
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
- name: Install the control plane
|
||||
hosts: kube_control_plane
|
||||
gather_facts: False
|
||||
gather_facts: false
|
||||
any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
|
||||
environment: "{{ proxy_disable_env }}"
|
||||
roles:
|
||||
@@ -41,7 +41,7 @@
|
||||
|
||||
- name: Invoke kubeadm and install a CNI
|
||||
hosts: k8s_cluster
|
||||
gather_facts: False
|
||||
gather_facts: false
|
||||
any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
|
||||
environment: "{{ proxy_disable_env }}"
|
||||
roles:
|
||||
@@ -54,7 +54,7 @@
|
||||
|
||||
- name: Install Calico Route Reflector
|
||||
hosts: calico_rr
|
||||
gather_facts: False
|
||||
gather_facts: false
|
||||
any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
|
||||
environment: "{{ proxy_disable_env }}"
|
||||
roles:
|
||||
@@ -63,7 +63,7 @@
|
||||
|
||||
- name: Patch Kubernetes for Windows
|
||||
hosts: kube_control_plane[0]
|
||||
gather_facts: False
|
||||
gather_facts: false
|
||||
any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
|
||||
environment: "{{ proxy_disable_env }}"
|
||||
roles:
|
||||
@@ -72,7 +72,7 @@
|
||||
|
||||
- name: Install Kubernetes apps
|
||||
hosts: kube_control_plane
|
||||
gather_facts: False
|
||||
gather_facts: false
|
||||
any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
|
||||
environment: "{{ proxy_disable_env }}"
|
||||
roles:
|
||||
@@ -86,7 +86,7 @@
|
||||
|
||||
- name: Apply resolv.conf changes now that cluster DNS is up
|
||||
hosts: k8s_cluster
|
||||
gather_facts: False
|
||||
gather_facts: false
|
||||
any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
|
||||
environment: "{{ proxy_disable_env }}"
|
||||
roles:
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
- name: Gather facts
|
||||
hosts: k8s_cluster:etcd:calico_rr
|
||||
gather_facts: False
|
||||
gather_facts: false
|
||||
tags: always
|
||||
tasks:
|
||||
- name: Gather minimal facts
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
- name: Install etcd
|
||||
hosts: etcd:kube_control_plane:_kubespray_needs_etcd
|
||||
gather_facts: False
|
||||
gather_facts: false
|
||||
any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
|
||||
environment: "{{ proxy_disable_env }}"
|
||||
roles:
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
|
||||
- name: Confirm node removal
|
||||
hosts: "{{ node | default('etcd:k8s_cluster:calico_rr') }}"
|
||||
gather_facts: no
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- name: Confirm Execution
|
||||
pause:
|
||||
prompt: "Are you sure you want to delete nodes state? Type 'yes' to delete nodes."
|
||||
register: pause_result
|
||||
run_once: True
|
||||
run_once: true
|
||||
when:
|
||||
- not (skip_confirmation | default(false) | bool)
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
- name: Reset node
|
||||
hosts: "{{ node | default('kube_node') }}"
|
||||
gather_facts: no
|
||||
gather_facts: false
|
||||
environment: "{{ proxy_disable_env }}"
|
||||
roles:
|
||||
- { role: kubespray-defaults, when: reset_nodes | default(True) | bool }
|
||||
@@ -36,7 +36,7 @@
|
||||
# Currently cannot remove first master or etcd
|
||||
- name: Post node removal
|
||||
hosts: "{{ node | default('kube_control_plane[1:]:etcd[1:]') }}"
|
||||
gather_facts: no
|
||||
gather_facts: false
|
||||
environment: "{{ proxy_disable_env }}"
|
||||
roles:
|
||||
- { role: kubespray-defaults, when: reset_nodes | default(True) | bool }
|
||||
|
||||
@@ -7,13 +7,13 @@
|
||||
|
||||
- name: Reset cluster
|
||||
hosts: etcd:k8s_cluster:calico_rr
|
||||
gather_facts: False
|
||||
gather_facts: false
|
||||
pre_tasks:
|
||||
- name: Reset Confirmation
|
||||
pause:
|
||||
prompt: "Are you sure you want to reset cluster state? Type 'yes' to reset your cluster."
|
||||
register: reset_confirmation_prompt
|
||||
run_once: True
|
||||
run_once: true
|
||||
when:
|
||||
- not (skip_confirmation | default(false) | bool)
|
||||
- reset_confirmation is not defined
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
- name: Generate the etcd certificates beforehand
|
||||
hosts: etcd:kube_control_plane
|
||||
gather_facts: False
|
||||
gather_facts: false
|
||||
any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
|
||||
environment: "{{ proxy_disable_env }}"
|
||||
roles:
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
- name: Download images to ansible host cache via first kube_control_plane node
|
||||
hosts: kube_control_plane[0]
|
||||
gather_facts: False
|
||||
gather_facts: false
|
||||
any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
|
||||
environment: "{{ proxy_disable_env }}"
|
||||
roles:
|
||||
@@ -34,7 +34,7 @@
|
||||
|
||||
- name: Target only workers to get kubelet installed and checking in on any new nodes(engine)
|
||||
hosts: kube_node
|
||||
gather_facts: False
|
||||
gather_facts: false
|
||||
any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
|
||||
environment: "{{ proxy_disable_env }}"
|
||||
roles:
|
||||
@@ -53,7 +53,7 @@
|
||||
|
||||
- name: Target only workers to get kubelet installed and checking in on any new nodes(node)
|
||||
hosts: kube_node
|
||||
gather_facts: False
|
||||
gather_facts: false
|
||||
any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
|
||||
environment: "{{ proxy_disable_env }}"
|
||||
roles:
|
||||
@@ -63,7 +63,7 @@
|
||||
- name: Upload control plane certs and retrieve encryption key
|
||||
hosts: kube_control_plane | first
|
||||
environment: "{{ proxy_disable_env }}"
|
||||
gather_facts: False
|
||||
gather_facts: false
|
||||
tags: kubeadm
|
||||
roles:
|
||||
- { role: kubespray-defaults }
|
||||
@@ -84,7 +84,7 @@
|
||||
|
||||
- name: Target only workers to get kubelet installed and checking in on any new nodes(network)
|
||||
hosts: kube_node
|
||||
gather_facts: False
|
||||
gather_facts: false
|
||||
any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
|
||||
environment: "{{ proxy_disable_env }}"
|
||||
roles:
|
||||
@@ -96,7 +96,7 @@
|
||||
|
||||
- name: Apply resolv.conf changes now that cluster DNS is up
|
||||
hosts: k8s_cluster
|
||||
gather_facts: False
|
||||
gather_facts: false
|
||||
any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
|
||||
environment: "{{ proxy_disable_env }}"
|
||||
roles:
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
- name: Download images to ansible host cache via first kube_control_plane node
|
||||
hosts: kube_control_plane[0]
|
||||
gather_facts: False
|
||||
gather_facts: false
|
||||
any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
|
||||
environment: "{{ proxy_disable_env }}"
|
||||
roles:
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
- name: Prepare nodes for upgrade
|
||||
hosts: k8s_cluster:etcd:calico_rr
|
||||
gather_facts: False
|
||||
gather_facts: false
|
||||
any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
|
||||
environment: "{{ proxy_disable_env }}"
|
||||
roles:
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
- name: Upgrade container engine on non-cluster nodes
|
||||
hosts: etcd:calico_rr:!k8s_cluster
|
||||
gather_facts: False
|
||||
gather_facts: false
|
||||
any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
|
||||
environment: "{{ proxy_disable_env }}"
|
||||
serial: "{{ serial | default('20%') }}"
|
||||
@@ -39,7 +39,7 @@
|
||||
import_playbook: install_etcd.yml
|
||||
|
||||
- name: Handle upgrades to master components first to maintain backwards compat.
|
||||
gather_facts: False
|
||||
gather_facts: false
|
||||
hosts: kube_control_plane
|
||||
any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
|
||||
environment: "{{ proxy_disable_env }}"
|
||||
@@ -62,7 +62,7 @@
|
||||
|
||||
- name: Upgrade calico and external cloud provider on all masters, calico-rrs, and nodes
|
||||
hosts: kube_control_plane:calico_rr:kube_node
|
||||
gather_facts: False
|
||||
gather_facts: false
|
||||
any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
|
||||
serial: "{{ serial | default('20%') }}"
|
||||
environment: "{{ proxy_disable_env }}"
|
||||
@@ -75,7 +75,7 @@
|
||||
|
||||
- name: Finally handle worker upgrades, based on given batch size
|
||||
hosts: kube_node:calico_rr:!kube_control_plane
|
||||
gather_facts: False
|
||||
gather_facts: false
|
||||
any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
|
||||
environment: "{{ proxy_disable_env }}"
|
||||
serial: "{{ serial | default('20%') }}"
|
||||
@@ -93,7 +93,7 @@
|
||||
|
||||
- name: Patch Kubernetes for Windows
|
||||
hosts: kube_control_plane[0]
|
||||
gather_facts: False
|
||||
gather_facts: false
|
||||
any_errors_fatal: true
|
||||
environment: "{{ proxy_disable_env }}"
|
||||
roles:
|
||||
@@ -102,7 +102,7 @@
|
||||
|
||||
- name: Install Calico Route Reflector
|
||||
hosts: calico_rr
|
||||
gather_facts: False
|
||||
gather_facts: false
|
||||
any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
|
||||
environment: "{{ proxy_disable_env }}"
|
||||
roles:
|
||||
@@ -111,7 +111,7 @@
|
||||
|
||||
- name: Install Kubernetes apps
|
||||
hosts: kube_control_plane
|
||||
gather_facts: False
|
||||
gather_facts: false
|
||||
any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
|
||||
environment: "{{ proxy_disable_env }}"
|
||||
roles:
|
||||
@@ -122,7 +122,7 @@
|
||||
|
||||
- name: Apply resolv.conf changes now that cluster DNS is up
|
||||
hosts: k8s_cluster
|
||||
gather_facts: False
|
||||
gather_facts: false
|
||||
any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
|
||||
environment: "{{ proxy_disable_env }}"
|
||||
roles:
|
||||
|
||||
Reference in New Issue
Block a user