From aa0ccc4ecf33a28759c6d73113b38977e22da066 Mon Sep 17 00:00:00 2001 From: igor04091968 Date: Sat, 9 May 2026 09:42:36 +0300 Subject: [PATCH] fix(ansible): run smoke-check on controller + per-user validation dir --- ansible/deploy_aw_windows.yml | 16 ++++++++++++++-- ansible/group_vars/aw_windows.yml | 2 +- ansible/group_vars/windows.example.yml | 2 +- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/ansible/deploy_aw_windows.yml b/ansible/deploy_aw_windows.yml index 1c0008e..4bbd054 100644 --- a/ansible/deploy_aw_windows.yml +++ b/ansible/deploy_aw_windows.yml @@ -285,11 +285,17 @@ url: "{{ aw_windows_server_scheme }}://{{ aw_windows_server_host }}:{{ aw_windows_server_port }}/api/0/buckets/{{ aw_windows_api_smoke_check_bucket_effective }}/events?limit={{ aw_windows_api_smoke_check_limit }}" method: GET status_code: 200 + return_content: true register: aw_windows_api_smoke_result - until: (aw_windows_api_smoke_result.json | length) >= aw_windows_api_smoke_check_min_events + failed_when: false + until: >- + (aw_windows_api_smoke_result.status | default(0)) == 200 + and ((aw_windows_api_smoke_result.json | default([])) | length) >= aw_windows_api_smoke_check_min_events retries: 12 delay: 5 ignore_errors: "{{ (not aw_windows_fail_on_validation_error | bool) }}" + delegate_to: localhost + changed_when: false - name: Выполнить AW API smoke-check (Window bucket должен получать события) when: @@ -300,11 +306,17 @@ url: "{{ aw_windows_server_scheme }}://{{ aw_windows_server_host }}:{{ aw_windows_server_port }}/api/0/buckets/{{ aw_windows_api_smoke_check_window_bucket_effective }}/events?limit={{ aw_windows_api_smoke_check_limit }}" method: GET status_code: 200 + return_content: true register: aw_windows_api_smoke_window_result - until: (aw_windows_api_smoke_window_result.json | length) >= aw_windows_api_smoke_check_min_events + failed_when: false + until: >- + (aw_windows_api_smoke_window_result.status | default(0)) == 200 + and ((aw_windows_api_smoke_window_result.json | default([])) | length) >= aw_windows_api_smoke_check_min_events retries: 12 delay: 5 ignore_errors: "{{ (not aw_windows_fail_on_validation_error | bool) }}" + delegate_to: localhost + changed_when: false - name: Валидировать развёртывание на эндпоинте ansible.windows.win_powershell: diff --git a/ansible/group_vars/aw_windows.yml b/ansible/group_vars/aw_windows.yml index ef87ba4..41cbbe8 100644 --- a/ansible/group_vars/aw_windows.yml +++ b/ansible/group_vars/aw_windows.yml @@ -42,7 +42,7 @@ aw_windows_rules_path: "{{ aw_windows_deploy_root }}\\windows\\web-category-rule aw_windows_policy_path: "{{ aw_windows_deploy_root }}\\windows\\dlp-policy.example.json" aw_windows_validation_remote_path: "{{ aw_windows_state_root }}\\aw_validate_ansible.json" -aw_windows_validation_local_dir: "/tmp/aw-rus-validation" +aw_windows_validation_local_dir: "/tmp/aw-rus-validation-{{ lookup('env','USER') | default('ansible', true) }}" aw_windows_fail_on_validation_error: true aw_windows_migration_enabled: false diff --git a/ansible/group_vars/windows.example.yml b/ansible/group_vars/windows.example.yml index 3a0d770..9021eb6 100644 --- a/ansible/group_vars/windows.example.yml +++ b/ansible/group_vars/windows.example.yml @@ -36,7 +36,7 @@ aw_windows_rules_path: "{{ aw_windows_deploy_root }}\\windows\\web-category-rule aw_windows_policy_path: "{{ aw_windows_deploy_root }}\\windows\\dlp-policy.example.json" aw_windows_validation_remote_path: "{{ aw_windows_state_root }}\\aw_validate_ansible.json" -aw_windows_validation_local_dir: "/tmp/aw-rus-validation" +aw_windows_validation_local_dir: "/tmp/aw-rus-validation-{{ lookup('env','USER') | default('ansible', true) }}" aw_windows_fail_on_validation_error: true # Безопасная миграция текущего прода со старых путей в единый профиль AWatch-rus.