Files
2026-03-29 09:08:01 +08:00

20 lines
833 B
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 可复用:等待 Deployment/StatefulSet/DaemonSet rollout 完成。
# 调用方需设置 verify_rollout_ref例如 deployment/nginx-m1
- name: Assert verify_rollout_ref is set
ansible.builtin.assert:
that:
- verify_rollout_ref is defined
- (verify_rollout_ref | trim | length) > 0
fail_msg: "verify_common kubectl-rollout-status缺少变量 verify_rollout_ref如 deployment/nginx-m1"
- name: kubectl rollout status (verify_common)
ansible.builtin.shell: |
set -euo pipefail
KUBECONFIG={{ k3s_kubeconfig | default('/etc/rancher/k3s/k3s.yaml') }} \
kubectl rollout status {{ verify_rollout_ref }} \
-n {{ verify_rollout_namespace | default('default') }} \
--timeout={{ verify_rollout_timeout_s | default(180) }}s
args:
executable: /bin/bash
changed_when: false