mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-10-31 14:36:20 -02:30
The plays carry `any_errors_fatal: "{{ any_errors_fatal | default(true) }}"`,
added in #1201 so the behaviour could be turned off.
`any_errors_fatal` is an Ansible play keyword, and Ansible reserves keyword
names in the variable namespace. Setting it through -e, group_vars or
host_vars is rejected with "Found variable using reserved name:
any_errors_fatal" and the value never reaches the play, so the expression
always falls through to `default(true)`. The knob has been inert since it was
introduced.
Rename the variable to `kubespray_any_errors_fatal`. Default behaviour is
unchanged -- still fatal -- but `-e kubespray_any_errors_fatal=false` now
works as #1201 intended.
This matters most in playbooks/internal_facts.yml, where the fatal bootstrap
play runs ahead of the play that gathers and caches facts: one unreachable
host aborts the run before any facts are cached, the playbook still exits 0,
and a later `scale.yml --limit=...` refuses because the excluded hosts have
no cache entries. roles/network_facts already sets ignore_unreachable: true
for this reason, but it never executes.
Refs #13407
Claude-Session: https://claude.ai/code/session_017RCEoUNR9gthd455d8Anrx
Signed-off-by: Weigang Geng <3356786+gengwg@users.noreply.github.com>
Co-authored-by: Weigang Geng <3356786+gengwg@users.noreply.github.com>
42 lines
1.1 KiB
YAML
42 lines
1.1 KiB
YAML
---
|
|
- name: Bootstrap hosts for Ansible
|
|
hosts: k8s_cluster:etcd:calico_rr
|
|
strategy: linear
|
|
any_errors_fatal: "{{ kubespray_any_errors_fatal | default(true) }}"
|
|
gather_facts: false
|
|
environment: "{{ proxy_disable_env }}"
|
|
roles:
|
|
- { role: bootstrap_os, tags: bootstrap_os}
|
|
|
|
- name: Gather facts
|
|
hosts: k8s_cluster:etcd:calico_rr
|
|
gather_facts: false
|
|
tags: always
|
|
tasks:
|
|
- name: Gather and compute network facts
|
|
import_role:
|
|
name: network_facts
|
|
tags:
|
|
- always
|
|
- name: Gather minimal facts
|
|
setup:
|
|
gather_subset: '!all'
|
|
|
|
# filter match the following variables:
|
|
# ansible_default_ipv4
|
|
# ansible_default_ipv6
|
|
# ansible_all_ipv4_addresses
|
|
# ansible_all_ipv6_addresses
|
|
- name: Gather necessary facts (network)
|
|
setup:
|
|
gather_subset: '!all,!min,network'
|
|
filter: "ansible_*_ipv[46]*"
|
|
|
|
# filter match the following variables:
|
|
# ansible_memtotal_mb
|
|
# ansible_swaptotal_mb
|
|
- name: Gather necessary facts (hardware)
|
|
setup:
|
|
gather_subset: '!all,!min,hardware'
|
|
filter: "ansible_*total_mb"
|