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,20 @@
- name: Копируем скрипты
copy:
src: "{{ item }}"
dest: /usr/local/bin/
mode: '0755'
with_items:
- collect_info.sh
- graylog_sender.py
- name: Выполняем bash-скрипт
shell: "/usr/local/bin/collect_info.sh"
environment:
OUTPUT_DIR: "{{ linux_output_dir }}"
- name: Отправляем лог в Graylog
shell: |
export GRAYLOG_HOST={{ graylog_host }}
export GRAYLOG_PORT={{ graylog_port }}
latest=$(ls -1t {{ linux_output_dir }}/command_results_*.log | head -n1)
python3 /usr/local/bin/graylog_sender.py $latest