docs: pass boolean extra-vars as JSON for Ansible 12 compatibility (#13526)

* docs: pass boolean extra-vars as JSON for Ansible 12 compatibility

Ansible 12 no longer accepts boolean values passed with -e var=true; the
value is treated as a string, which breaks conditionals that expect a
boolean. Update all documentation examples to use JSON syntax for boolean
extra-vars and link to the Ansible 12 porting guide.

Signed-off-by: Shashank Varma <324153016+shashankvarma499@users.noreply.github.com>

* docs: clarify Ansible boolean types and configuration examples

Signed-off-by: Kay Yan <kay.yan@daocloud.io>

---------

Signed-off-by: Shashank Varma <324153016+shashankvarma499@users.noreply.github.com>
Signed-off-by: Kay Yan <kay.yan@daocloud.io>
Co-authored-by: Shashank Varma <324153016+shashankvarma499@users.noreply.github.com>
Co-authored-by: Kay Yan <kay.yan@daocloud.io>
This commit is contained in:
Shashank Varma
2026-09-20 06:05:59 +00:00
committed by GitHub
co-authored by Shashank Varma Kay Yan
parent b8ad8289a8
commit 2af9b1cc94
6 changed files with 17 additions and 18 deletions
+4 -4
View File
@@ -26,16 +26,16 @@ If you wanted to upgrade just kube_version from v1.18.10 to v1.19.7, you could
deploy the following way:
```ShellSession
ansible-playbook cluster.yml -i inventory/sample/inventory.ini -e kube_version=1.18.10 -e upgrade_cluster_setup=true
ansible-playbook cluster.yml -i inventory/sample/inventory.ini -e kube_version=1.18.10 -e '{"upgrade_cluster_setup": true}'
```
And then repeat with 1.19.7 as kube_version:
```ShellSession
ansible-playbook cluster.yml -i inventory/sample/inventory.ini -e kube_version=1.19.7 -e upgrade_cluster_setup=true
ansible-playbook cluster.yml -i inventory/sample/inventory.ini -e kube_version=1.19.7 -e '{"upgrade_cluster_setup": true}'
```
The var ```-e upgrade_cluster_setup=true``` is needed to be set in order to migrate the deploys of e.g kube-apiserver inside the cluster immediately which is usually only done in the graceful upgrade. (Refer to [#4139](https://github.com/kubernetes-sigs/kubespray/issues/4139) and [#4736](https://github.com/kubernetes-sigs/kubespray/issues/4736))
The var ```-e '{"upgrade_cluster_setup": true}'``` is needed to be set in order to migrate the deploys of e.g kube-apiserver inside the cluster immediately which is usually only done in the graceful upgrade. (Refer to [#4139](https://github.com/kubernetes-sigs/kubespray/issues/4139) and [#4736](https://github.com/kubernetes-sigs/kubespray/issues/4736))
## Graceful upgrade
@@ -430,7 +430,7 @@ As of Kubespray 2.18.0, containerd is already the default container engine. If y
If you want to upgrade the APT or YUM packages while the nodes are cordoned, you can use:
```ShellSession
ansible-playbook upgrade-cluster.yml -b -i inventory/sample/inventory.ini -e system_upgrade=true
ansible-playbook upgrade-cluster.yml -b -i inventory/sample/inventory.ini -e '{"system_upgrade": true}'
```
Nodes will be rebooted when there are package upgrades (`system_upgrade_reboot: on-upgrade`).