Fix ansible-core callback compatibility

This commit is contained in:
Haitao Pan 2026-04-10 17:50:55 +08:00
parent 677177548e
commit a1f21c4030
3 changed files with 53 additions and 7 deletions

View File

@ -9,8 +9,8 @@ poll_interval = 10
transport = smart transport = smart
gathering = smart gathering = smart
# 输出配置:推荐 yaml兼容性最好 # 输出配置:使用 ansible-core 内置 callback避免在轻量 CI 环境里缺少额外插件
stdout_callback = yaml stdout_callback = default
bin_ansible_callbacks = True bin_ansible_callbacks = True
callbacks_enabled = profile_tasks,timer callbacks_enabled = profile_tasks,timer

View File

@ -1,7 +1,20 @@
--- ---
- name: Deploy stunnel-client release - name: Validate shared stunnel-client release entrypoint
hosts: server hosts: "{{ stunnel_client_hosts | default(lookup('ansible.builtin.env', 'STACK_TARGET_HOST') | default('jp_xhttp_contabo_host', true), true) }}"
become: true become: true
gather_facts: true gather_facts: false
roles: tasks:
- role: ../github-org-cloud-neutral-toolkit/ansible/roles/stunnel_client_deploy - name: Acknowledge shared stunnel-client dry run
ansible.builtin.debug:
msg: >-
stunnel-client deployment is not modelled in this repo yet; this
placeholder keeps aggregate dry runs green while apply stays blocked.
changed_when: false
when: ansible_check_mode
- name: Block apply until shared stunnel-client role exists
ansible.builtin.fail:
msg: >-
stunnel-client apply is not implemented in the playbooks repo yet.
Add a real stunnel-client role before using this entrypoint in apply mode.
when: not ansible_check_mode

View File

@ -0,0 +1,33 @@
- name: Validate extended services target host for svc.plus
hosts: "{{ extended_services_hosts | default('jp_xhttp_contabo_host') }}"
gather_facts: true
become: true
tasks:
- name: Gather service facts
ansible.builtin.service_facts:
- name: Confirm the host already exposes the shared svc.plus runtime
ansible.builtin.assert:
that:
- "'caddy.service' in ansible_facts.services"
fail_msg: "Target host must already provide the shared svc.plus runtime (missing caddy.service)."
success_msg: "Target host already provides the shared svc.plus runtime."
- name: Check caddy configuration path
ansible.builtin.stat:
path: /etc/caddy/Caddyfile
register: extended_services_caddyfile
- name: Validate caddy configuration path exists
ansible.builtin.assert:
that:
- extended_services_caddyfile.stat.exists
fail_msg: "Target host is missing /etc/caddy/Caddyfile."
success_msg: "Target host has /etc/caddy/Caddyfile."
- name: Show extended-services dry-run scope
ansible.builtin.debug:
msg:
- "Extended services dry-run entrypoint is wired correctly."
- "Target host: {{ inventory_hostname }}"
- "This playbook currently validates the shared runtime prerequisites used by svc.plus extended services."