2017-08-15 05:13:14 +00:00
|
|
|
# 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
|
2018-01-07 04:05:15 +00:00
|
|
|
import_tasks: tests.yml
|
2017-08-15 05:13:14 +00:00
|
|
|
vars:
|
|
|
|
in_check_mode: no
|
|
|
|
|
|
|
|
- name: Test in check-mode
|
2018-01-07 04:05:15 +00:00
|
|
|
import_tasks: tests.yml
|
2017-08-15 05:13:14 +00:00
|
|
|
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 }}"
|