This commit is contained in:
2025-06-09 19:34:56 +09:00
parent 02a10ca391
commit cdc4e209c7
15 changed files with 490 additions and 1 deletions

View File

@@ -0,0 +1,27 @@
- name: Создаем каталог логов
win_file:
path: "{{ log_output_dir }}"
state: directory
- name: Копируем скрипты
win_copy:
src: "{{ item }}"
dest: "{{ log_output_dir }}/{{ item }}"
with_items:
- run_commands.py
- graylog_sender.py
- name: Выполняем команды и сохраняем в лог
win_shell: |
cd {{ log_output_dir }}
python run_commands.py
args:
executable: cmd
- name: Отправляем лог в Graylog
win_shell: |
set GRAYLOG_HOST={{ graylog_host }}
set GRAYLOG_PORT={{ graylog_port }}
python {{ log_output_dir }}\graylog_sender.py {{ log_output_dir }}\command_results.txt
args:
executable: cmd