29 lines
715 B
YAML
29 lines
715 B
YAML
|
---
|
||
|
- name: create dummy network adapter device
|
||
|
win_device:
|
||
|
path: '%WinDir%\Inf\netloop.inf'
|
||
|
hardware_id: '*msloop'
|
||
|
state: present
|
||
|
register: test_device_name
|
||
|
|
||
|
- set_fact:
|
||
|
test_device_name: '{{ test_device_name.name }}'
|
||
|
|
||
|
- block:
|
||
|
- name: get name of the dummy network adapter
|
||
|
win_shell: (Get-CimInstance -Class Win32_NetworkAdapter -Filter "Name='{{ test_device_name }}'").NetConnectionID
|
||
|
changed_when: False
|
||
|
register: test_adapter
|
||
|
|
||
|
- set_fact:
|
||
|
test_adapter: '{{ test_adapter.stdout | trim }}'
|
||
|
|
||
|
- name: run tests
|
||
|
include_tasks: tests.yml
|
||
|
|
||
|
always:
|
||
|
- name: remove dummy network adapter device
|
||
|
win_device:
|
||
|
name: '{{ test_device_name }}'
|
||
|
state: absent
|