51 lines
1.5 KiB
YAML
51 lines
1.5 KiB
YAML
|
|
---
|
||
|
|
# =============================================================================
|
||
|
|
# request_log/tasks — Deploy Telemetry Table
|
||
|
|
# =============================================================================
|
||
|
|
# "This is non-negotiable infrastructure. Without it, we cannot verify
|
||
|
|
# if any agent actually executed what it claims."
|
||
|
|
# — KT Bezalel 2026-04-08
|
||
|
|
# =============================================================================
|
||
|
|
|
||
|
|
- name: "Create telemetry directory"
|
||
|
|
file:
|
||
|
|
path: "{{ request_log_path | dirname }}"
|
||
|
|
state: directory
|
||
|
|
mode: "0755"
|
||
|
|
|
||
|
|
- name: "Deploy request_log schema"
|
||
|
|
copy:
|
||
|
|
src: request_log_schema.sql
|
||
|
|
dest: "{{ wizard_home }}/request_log_schema.sql"
|
||
|
|
mode: "0644"
|
||
|
|
|
||
|
|
- name: "Initialize request_log database"
|
||
|
|
shell: |
|
||
|
|
sqlite3 "{{ request_log_path }}" < "{{ wizard_home }}/request_log_schema.sql"
|
||
|
|
args:
|
||
|
|
creates: "{{ request_log_path }}"
|
||
|
|
|
||
|
|
- name: "Verify request_log table exists"
|
||
|
|
shell: |
|
||
|
|
sqlite3 "{{ request_log_path }}" ".tables" | grep -q "request_log"
|
||
|
|
register: table_check
|
||
|
|
changed_when: false
|
||
|
|
|
||
|
|
- name: "Verify request_log schema matches"
|
||
|
|
shell: |
|
||
|
|
sqlite3 "{{ request_log_path }}" ".schema request_log" | grep -q "agent_name"
|
||
|
|
register: schema_check
|
||
|
|
changed_when: false
|
||
|
|
|
||
|
|
- name: "Set permissions on request_log database"
|
||
|
|
file:
|
||
|
|
path: "{{ request_log_path }}"
|
||
|
|
mode: "0644"
|
||
|
|
|
||
|
|
- name: "Report request_log status"
|
||
|
|
debug:
|
||
|
|
msg: >
|
||
|
|
{{ wizard_name }} request_log: {{ request_log_path }}
|
||
|
|
— table exists: {{ table_check.rc == 0 }}
|
||
|
|
— schema valid: {{ schema_check.rc == 0 }}
|