mirror of https://github.com/ansible/ansible.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
815 B
YAML
23 lines
815 B
YAML
5 years ago
|
# Creates a network adapter device for testing purposes and registers the following vars
|
||
|
# network_device_name: The name of the network device
|
||
|
# network_adapter_name: The name of the network adapter
|
||
|
---
|
||
|
- name: create dummy network adapter device
|
||
|
win_device:
|
||
|
path: '%WinDir%\Inf\netloop.inf'
|
||
|
hardware_id: '*msloop'
|
||
|
state: present
|
||
|
register: network_device_name_raw
|
||
|
notify: remove dummy network adapter device
|
||
|
|
||
|
- set_fact:
|
||
|
network_device_name: '{{ network_device_name_raw.name }}'
|
||
|
|
||
|
- name: get name of the dummy network adapter
|
||
|
win_shell: (Get-CimInstance -Class Win32_NetworkAdapter -Filter "Name='{{ network_device_name }}'").NetConnectionID
|
||
|
changed_when: False
|
||
|
register: network_adapter_name_raw
|
||
|
|
||
|
- set_fact:
|
||
|
network_adapter_name: '{{ network_adapter_name_raw.stdout | trim }}'
|