70 lines
2.7 KiB
YAML
70 lines
2.7 KiB
YAML
---
|
|
- name: Validate Caddy configuration
|
|
ansible.builtin.command: caddy validate --config "{{ acp_opencode_caddyfile_path }}"
|
|
changed_when: false
|
|
|
|
- name: Check OpenCode ACP listener
|
|
ansible.builtin.command: ss -ltnp
|
|
register: acp_opencode_ss
|
|
changed_when: false
|
|
|
|
- name: Validate OpenCode local HTML endpoint
|
|
ansible.builtin.uri:
|
|
url: "http://{{ acp_opencode_listen_host }}:{{ acp_opencode_listen_port }}/"
|
|
method: GET
|
|
return_content: true
|
|
status_code: 200
|
|
register: acp_opencode_http
|
|
|
|
- name: Validate local OpenCode ACP bridge HTTP endpoint
|
|
ansible.builtin.uri:
|
|
url: "http://{{ acp_opencode_bridge_listen_host }}:{{ acp_opencode_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_opencode_bridge_http
|
|
|
|
- name: Validate local OpenCode ACP bridge CORS preflight
|
|
ansible.builtin.uri:
|
|
url: "http://{{ acp_opencode_bridge_listen_host }}:{{ acp_opencode_bridge_listen_port }}/acp/rpc"
|
|
method: OPTIONS
|
|
headers:
|
|
Origin: "{{ acp_opencode_bridge_allowed_origins[0] }}"
|
|
Access-Control-Request-Method: POST
|
|
return_content: true
|
|
status_code: [204, 405]
|
|
register: acp_opencode_bridge_preflight
|
|
|
|
- name: Show OpenCode ACP status
|
|
ansible.builtin.command: systemctl status "{{ acp_opencode_service_name }}" --no-pager
|
|
register: acp_opencode_status
|
|
changed_when: false
|
|
failed_when: false
|
|
|
|
- name: Show OpenCode ACP bridge status
|
|
ansible.builtin.command: systemctl status "{{ acp_opencode_bridge_service_name }}" --no-pager
|
|
register: acp_opencode_bridge_status
|
|
changed_when: false
|
|
failed_when: false
|
|
|
|
- name: Show OpenCode ACP validation summary
|
|
ansible.builtin.debug:
|
|
msg:
|
|
- "OpenCode domain: {{ acp_opencode_domain }}"
|
|
- "OpenCode UI listener: {{ acp_opencode_listen_host }}:{{ acp_opencode_listen_port }}"
|
|
- "ACP bridge listener: {{ acp_opencode_bridge_listen_host }}:{{ acp_opencode_bridge_listen_port }}"
|
|
- "Service: {{ acp_opencode_status.stdout | default('N/A') }}"
|
|
- "Bridge service: {{ acp_opencode_bridge_status.stdout | default('N/A') }}"
|
|
- "Socket: {{ acp_opencode_ss.stdout | default('N/A') }}"
|
|
- "HTML content-type: {{ acp_opencode_http.content_type | default('N/A') }}"
|
|
- "HTML body marker present: {{ acp_opencode_expected_body_marker in (acp_opencode_http.content | default('')) }}"
|
|
- "Bridge capabilities HTTP: {{ acp_opencode_bridge_http.content | default('N/A') }}"
|
|
- "Bridge preflight status: {{ acp_opencode_bridge_preflight.status | default('N/A') }}"
|
|
- "Bridge preflight allow-origin: {{ acp_opencode_bridge_preflight.access_control_allow_origin | default('N/A') }}"
|