17 lines
731 B
YAML
17 lines
731 B
YAML
# 可复用:仅在进入门禁分支时输出一行 [GATE] 并 end_play。
|
||
# 调用方在「本 task」上写 when:;条件为假时整段 include 被跳过,不会出现 debug/meta 两条 skipping。
|
||
# 必填:verify_gate_message(字符串,须含 [GATE] 供 verify.sh 解析)
|
||
- name: Assert verify_gate_message for gate-debug-end-play
|
||
ansible.builtin.assert:
|
||
that:
|
||
- verify_gate_message is defined
|
||
- (verify_gate_message | string | trim | length) > 0
|
||
fail_msg: "verify_common gate-debug-end-play:需设置 verify_gate_message"
|
||
|
||
- name: Emit gated message (verify_common)
|
||
ansible.builtin.debug:
|
||
msg: "{{ verify_gate_message }}"
|
||
|
||
- name: End play after gate (verify_common)
|
||
meta: end_play
|