090600
This commit is contained in:
27
roles/graylog_collector/tasks/windows.yml
Normal file
27
roles/graylog_collector/tasks/windows.yml
Normal 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
|
||||
Reference in New Issue
Block a user