07_check_calico.yml - Usage Guide
Purpose
This playbook reports the current Calico CNI version (calico-node DaemonSet image tag) and, optionally, applies a new manifest to upgrade it.
⚠️ Calico is not an apt package; it is a DaemonSet running in the cluster. If calico_manifest_url is set, a real upgrade is applied (this is not read-only). Check Calico’s official upgrade guide before skipping versions — some jumps also require a CRD update.
Requirements
- Runs on the first control-plane node with
kubectlaccess (the first host in themaster/singlenodegroup). - To upgrade, set
calico_manifest_url; if it is omitted, only the current version is reported.
How to run
# Report the current version only:
ansible-playbook -i inventories/musteri_a/hosts.ini playbooks/07_check_calico.yml
# Upgrade:
ansible-playbook -i inventories/musteri_a/hosts.ini playbooks/07_check_calico.yml \
--extra-vars "calico_manifest_url=https://raw.githubusercontent.com/projectcalico/calico/v3.31.1/manifests/calico.yaml"
Sample output
TASK [Ping connectivity test] **************************************************
ok: [203.0.113.10]
TASK [Kubeconfig / kubectl access check (when: first control-plane node)] ***
ok: [203.0.113.10]
TASK [calico_manifest_url not provided warning (when: calico_manifest_url must NOT be set)] ***
ok: [203.0.113.10] => {
"msg": "calico_manifest_url was not set; no update was applied. Example: --extra-vars \"calico_manifest_url=<official manifest URL>\""
}
TASK [Calico version report (when: first control-plane node and kubectl access)] ***
ok: [203.0.113.10] => {
"msg": "Calico: quay.io/calico/node:v3.31.1 -> quay.io/calico/node:v3.31.1"
}