mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
34 lines
965 B
YAML
34 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 }}"
|