62 lines
2.4 KiB
YAML
62 lines
2.4 KiB
YAML
---
|
|
- name: Validate Caddy configuration
|
|
ansible.builtin.command: caddy validate --config "{{ acp_codex_caddyfile_path }}"
|
|
changed_when: false
|
|
|
|
- name: Check Codex app server listener
|
|
ansible.builtin.command: ss -ltnp
|
|
register: acp_codex_ss
|
|
changed_when: false
|
|
|
|
- name: Validate local Codex ACP bridge HTTP endpoint
|
|
ansible.builtin.uri:
|
|
url: "http://{{ acp_codex_bridge_listen_host }}:{{ acp_codex_bridge_listen_port }}/acp/rpc"
|
|
method: POST
|
|
body_format: json
|
|
body:
|
|
jsonrpc: "2.0"
|
|
id: 1
|
|
method: acp.capabilities
|
|
params: {}
|
|
return_content: true
|
|
status_code: 200
|
|
register: acp_codex_bridge_http
|
|
|
|
- name: Validate local Codex ACP bridge CORS preflight
|
|
ansible.builtin.uri:
|
|
url: "http://{{ acp_codex_bridge_listen_host }}:{{ acp_codex_bridge_listen_port }}/acp/rpc"
|
|
method: OPTIONS
|
|
headers:
|
|
Origin: "{{ acp_codex_bridge_allowed_origins[0] }}"
|
|
Access-Control-Request-Method: POST
|
|
return_content: true
|
|
status_code: [204, 405]
|
|
register: acp_codex_bridge_preflight
|
|
|
|
- name: Show Codex ACP status
|
|
ansible.builtin.command: systemctl status "{{ acp_codex_service_name }}" --no-pager
|
|
register: acp_codex_status
|
|
changed_when: false
|
|
failed_when: false
|
|
|
|
- name: Show Codex ACP bridge status
|
|
ansible.builtin.command: systemctl status "{{ acp_codex_bridge_service_name }}" --no-pager
|
|
register: acp_codex_bridge_status
|
|
changed_when: false
|
|
failed_when: false
|
|
|
|
- name: Show Codex ACP validation summary
|
|
ansible.builtin.debug:
|
|
msg:
|
|
- "Codex public base URL: {{ acp_codex_public_base_url }}"
|
|
- "Preferred WebSocket endpoint: {{ acp_codex_public_base_url }}/acp"
|
|
- "Compatibility HTTP RPC endpoint: {{ acp_codex_public_base_url }}/acp/rpc"
|
|
- "Upstream listener: {{ acp_codex_listen_host }}:{{ acp_codex_listen_port }}"
|
|
- "Public ACP listener: {{ acp_codex_bridge_listen_host }}:{{ acp_codex_bridge_listen_port }}"
|
|
- "Service: {{ acp_codex_status.stdout | default('N/A') }}"
|
|
- "Bridge service: {{ acp_codex_bridge_status.stdout | default('N/A') }}"
|
|
- "Socket: {{ acp_codex_ss.stdout | default('N/A') }}"
|
|
- "Bridge capabilities HTTP: {{ acp_codex_bridge_http.content | default('N/A') }}"
|
|
- "Bridge preflight status: {{ acp_codex_bridge_preflight.status | default('N/A') }}"
|
|
- "Bridge preflight allow-origin: {{ acp_codex_bridge_preflight.access_control_allow_origin | default('N/A') }}"
|