diff --git a/roles/web-app-mattermost/tasks/utils/ai_gateway.yml b/roles/web-app-mattermost/tasks/utils/ai_gateway.yml index 57f6ec66d5..a45df851e4 100644 --- a/roles/web-app-mattermost/tasks/utils/ai_gateway.yml +++ b/roles/web-app-mattermost/tasks/utils/ai_gateway.yml @@ -20,7 +20,7 @@ - name: "🔎 Mattermost | Compare the stored Agents config to the contract" database_query: config: "{{ lookup('database', application_id) }}" - query: "{{ lookup('template', role_path ~ '/templates/sql/select/ai-service.sql.j2') }}" # nocheck: database-query-raw the desired service and bot are rendered from role vars + query: "{{ lookup('template', role_path ~ '/templates/sql/select/ai/service.sql.j2') }}" # nocheck: database-query-raw the desired service and bot are rendered from role vars expect_rows: true mask_values: "{{ MASK_CREDENTIALS_IN_LOGS | bool }}" register: mattermost_ai_state @@ -34,7 +34,7 @@ - name: "🔎 Mattermost | Count the Agents bot accounts the plugin has provisioned" database_query: config: "{{ lookup('database', application_id) }}" - query: "{{ lookup('template', role_path ~ '/templates/sql/select/ai-bot-user.sql.j2') }}" # nocheck: database-query-raw the bot username is templated into the predicate + query: "{{ lookup('template', role_path ~ '/templates/sql/select/ai/bot-user.sql.j2') }}" # nocheck: database-query-raw the bot username is templated into the predicate expect_rows: true register: mattermost_ai_bot_state changed_when: false @@ -63,7 +63,7 @@ - name: "🔎 Mattermost | Re-read the stored Agents service and bot" database_query: config: "{{ lookup('database', application_id) }}" - query: "{{ lookup('template', role_path ~ '/templates/sql/select/ai-service.sql.j2') }}" # nocheck: database-query-raw the desired service and bot are rendered from role vars + query: "{{ lookup('template', role_path ~ '/templates/sql/select/ai/service.sql.j2') }}" # nocheck: database-query-raw the desired service and bot are rendered from role vars expect_rows: true mask_values: "{{ MASK_CREDENTIALS_IN_LOGS | bool }}" register: mattermost_ai_state_final @@ -84,7 +84,7 @@ - name: "🔎 Mattermost | Wait for the Agents plugin to provision its bot account" database_query: config: "{{ lookup('database', application_id) }}" - query: "{{ lookup('template', role_path ~ '/templates/sql/select/ai-bot-user.sql.j2') }}" # nocheck: database-query-raw the bot username is templated into the predicate + query: "{{ lookup('template', role_path ~ '/templates/sql/select/ai/bot-user.sql.j2') }}" # nocheck: database-query-raw the bot username is templated into the predicate expect_rows: true register: mattermost_ai_bot_final retries: 60 diff --git a/roles/web-app-mattermost/templates/sql/select/ai-bot-user.sql.j2 b/roles/web-app-mattermost/templates/sql/select/ai/bot-user.sql.j2 similarity index 100% rename from roles/web-app-mattermost/templates/sql/select/ai-bot-user.sql.j2 rename to roles/web-app-mattermost/templates/sql/select/ai/bot-user.sql.j2 diff --git a/roles/web-app-mattermost/templates/sql/select/ai-service.sql.j2 b/roles/web-app-mattermost/templates/sql/select/ai/service.sql.j2 similarity index 100% rename from roles/web-app-mattermost/templates/sql/select/ai-service.sql.j2 rename to roles/web-app-mattermost/templates/sql/select/ai/service.sql.j2 diff --git a/roles/web-app-n8n/files/provision_ai.py b/roles/web-app-n8n/files/provision/ai.py similarity index 100% rename from roles/web-app-n8n/files/provision_ai.py rename to roles/web-app-n8n/files/provision/ai.py diff --git a/roles/web-app-n8n/files/provision_mcp.py b/roles/web-app-n8n/files/provision/mcp.py similarity index 100% rename from roles/web-app-n8n/files/provision_mcp.py rename to roles/web-app-n8n/files/provision/mcp.py diff --git a/roles/web-app-n8n/tasks/utils/ai_gateway.yml b/roles/web-app-n8n/tasks/utils/ai_gateway.yml index e10bc12b24..6d4807c834 100644 --- a/roles/web-app-n8n/tasks/utils/ai_gateway.yml +++ b/roles/web-app-n8n/tasks/utils/ai_gateway.yml @@ -7,7 +7,7 @@ argv: - python3 - "-" - stdin: "{{ lookup('file', 'provision_ai.py') }}" + stdin: "{{ lookup('file', 'provision/ai.py') }}" environment: N8N_BASE: "{{ N8N_INTERNAL_API_URL }}" N8N_OWNER_EMAIL: "{{ N8N_OWNER_EMAIL }}" diff --git a/roles/web-app-n8n/tasks/utils/mcp.yml b/roles/web-app-n8n/tasks/utils/mcp.yml index 8694a77fae..4c8b58239f 100644 --- a/roles/web-app-n8n/tasks/utils/mcp.yml +++ b/roles/web-app-n8n/tasks/utils/mcp.yml @@ -4,7 +4,7 @@ argv: - python3 - "-" - stdin: "{{ lookup('file', 'provision_mcp.py') }}" + stdin: "{{ lookup('file', 'provision/mcp.py') }}" environment: N8N_BASE: "{{ N8N_INTERNAL_API_URL }}" N8N_OWNER_EMAIL: "{{ N8N_OWNER_EMAIL }}" diff --git a/roles/web-app-wordpress/files/ai_engine_configure.php b/roles/web-app-wordpress/files/ai_engine/configure.php similarity index 100% rename from roles/web-app-wordpress/files/ai_engine_configure.php rename to roles/web-app-wordpress/files/ai_engine/configure.php diff --git a/roles/web-app-wordpress/files/ai_engine_endpoint.php b/roles/web-app-wordpress/files/ai_engine/endpoint.php similarity index 100% rename from roles/web-app-wordpress/files/ai_engine_endpoint.php rename to roles/web-app-wordpress/files/ai_engine/endpoint.php diff --git a/roles/web-app-wordpress/tasks/addons/ai-engine-stack-host.yml b/roles/web-app-wordpress/tasks/addons/ai-engine-stack-host.yml index bb6d7c1667..2eca2d9799 100644 --- a/roles/web-app-wordpress/tasks/addons/ai-engine-stack-host.yml +++ b/roles/web-app-wordpress/tasks/addons/ai-engine-stack-host.yml @@ -17,7 +17,7 @@ - eval-file - "-" - "--path={{ WORDPRESS_DOCKER_HTML_PATH }}" - stdin: "{{ lookup('file', 'ai_engine_configure.php') }}" + stdin: "{{ lookup('file', 'ai_engine/configure.php') }}" changed_when: true no_log: "{{ MASK_CREDENTIALS_IN_LOGS | bool }}" @@ -36,7 +36,7 @@ - eval-file - "-" - "--path={{ WORDPRESS_DOCKER_HTML_PATH }}" - stdin: "{{ lookup('file', 'ai_engine_endpoint.php') }}" + stdin: "{{ lookup('file', 'ai_engine/endpoint.php') }}" register: wordpress_ai_endpoint changed_when: false diff --git a/tests/unit/roles/web-app-n8n/test_provision_mcp.py b/tests/unit/roles/web-app-n8n/test_provision_mcp.py index 1863cea436..0461204c33 100644 --- a/tests/unit/roles/web-app-n8n/test_provision_mcp.py +++ b/tests/unit/roles/web-app-n8n/test_provision_mcp.py @@ -1,4 +1,4 @@ -"""Unit tests for ``roles/web-app-n8n/files/provision_mcp.py``.""" +"""Unit tests for ``roles/web-app-n8n/files/provision/mcp.py``.""" from __future__ import annotations @@ -8,7 +8,7 @@ from unittest.mock import patch from . import PROJECT_ROOT -SCRIPT_PATH = PROJECT_ROOT / "roles/web-app-n8n/files/provision_mcp.py" +SCRIPT_PATH = PROJECT_ROOT / "roles/web-app-n8n/files/provision/mcp.py" ENV = { "N8N_BASE": "http://n8n:5678",