From a1f21c403053f8d99c5f1cc057c5d7e847c3c027 Mon Sep 17 00:00:00 2001 From: Haitao Pan Date: Fri, 10 Apr 2026 17:50:55 +0800 Subject: [PATCH] Fix ansible-core callback compatibility --- ansible.cfg | 4 ++-- deploy_stunnel-client.yml | 23 +++++++++++++++---- deploy_svc_plus_extended-services.yml | 33 +++++++++++++++++++++++++++ 3 files changed, 53 insertions(+), 7 deletions(-) create mode 100644 deploy_svc_plus_extended-services.yml diff --git a/ansible.cfg b/ansible.cfg index 6b3837b..bab832e 100644 --- a/ansible.cfg +++ b/ansible.cfg @@ -9,8 +9,8 @@ poll_interval = 10 transport = smart gathering = smart -# 输出配置:推荐 yaml,兼容性最好 -stdout_callback = yaml +# 输出配置:使用 ansible-core 内置 callback,避免在轻量 CI 环境里缺少额外插件 +stdout_callback = default bin_ansible_callbacks = True callbacks_enabled = profile_tasks,timer diff --git a/deploy_stunnel-client.yml b/deploy_stunnel-client.yml index 97ed74e..75e9642 100644 --- a/deploy_stunnel-client.yml +++ b/deploy_stunnel-client.yml @@ -1,7 +1,20 @@ --- -- name: Deploy stunnel-client release - hosts: server +- name: Validate shared stunnel-client release entrypoint + hosts: "{{ stunnel_client_hosts | default(lookup('ansible.builtin.env', 'STACK_TARGET_HOST') | default('jp_xhttp_contabo_host', true), true) }}" become: true - gather_facts: true - roles: - - role: ../github-org-cloud-neutral-toolkit/ansible/roles/stunnel_client_deploy + gather_facts: false + tasks: + - 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 diff --git a/deploy_svc_plus_extended-services.yml b/deploy_svc_plus_extended-services.yml new file mode 100644 index 0000000..93bd744 --- /dev/null +++ b/deploy_svc_plus_extended-services.yml @@ -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."