Add windows role
Set up network interfaces and SSH for Windows hosts. We can’t gather facts before we know which remote shell to use, so first run a win_ping to determine if a given host is running Windows.
This commit is contained in:
parent
aa78b407c8
commit
91de26af57
7 changed files with 123 additions and 21 deletions
12
roles/windows/tasks/interface.yml
Normal file
12
roles/windows/tasks/interface.yml
Normal file
|
@ -0,0 +1,12 @@
|
|||
- name: Rename interface
|
||||
win_shell: >
|
||||
Get-NetAdapter
|
||||
| Where-Object -Property MacAddress -eq "{{ interface.mac_address | replace(':', '-') }}"
|
||||
| Rename-NetAdapter -NewName "{{ interface.name }}"
|
||||
changed_when: false # not really but we don’t care
|
||||
|
||||
- include_tasks: interface_address.yml
|
||||
loop: "{{ interface.ip_addresses }}"
|
||||
loop_control:
|
||||
label: "{{ interface.name }}"
|
||||
loop_var: address
|
Loading…
Add table
Add a link
Reference in a new issue