27 lines
728 B
YAML
27 lines
728 B
YAML
- 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 |