1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/test/integration/targets/win_eventlog_entry/tasks/main.yml
Andrew Saraceni bb7813f16f New Module: Write Windows event log entries (win_eventlog_entry) (#27828)
* initial commit for win_eventlog_entry module

* added test module for integration tests and minor documentation fixes
2017-08-15 01:13:14 -04:00

33 lines
965 B
YAML

# win_shell invocations can eventually be replaced with win_eventlog
- name: Remove potentially leftover test logs and sources
win_shell: Remove-EventLog -LogName "{{ item.log }}" -ErrorAction SilentlyContinue
with_items:
- "{{ win_test_log_source }}"
- "{{ win_test_log_source_extra }}"
failed_when: no
- name: Add new test logs and sources
win_shell: New-EventLog -LogName "{{ item.log }}" -Source "{{ item.source }}"
with_items:
- "{{ win_test_log_source }}"
- "{{ win_test_log_source_extra }}"
- name: Run tests for win_eventlog_entry
block:
- name: Test in normal mode
include_tasks: tests.yml
vars:
in_check_mode: no
- name: Test in check-mode
include_tasks: tests.yml
vars:
in_check_mode: yes
check_mode: yes
- name: Remove test logs and sources
win_shell: Remove-EventLog -LogName "{{ item.log }}"
with_items:
- "{{ win_test_log_source }}"
- "{{ win_test_log_source_extra }}"