Created
October 11, 2020 16:31
-
-
Save FlorianHeigl/db05ab4db32dbb6a88951c10309ae63b to your computer and use it in GitHub Desktop.
windows-ansible
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: Download and run ConfigureRemotingForAnsible.ps1 to setup WinRM | |
psexec: | |
hostname: '{{ hostvars[inventory_hostname]["ansible_host"] | default(inventory_hostname) }}' | |
connection_username: '{{ ansible_user }}' | |
connection_password: '{{ ansible_password }}' | |
encrypt: yes | |
executable: powershell.exe | |
arguments: '-' | |
stdin: | | |
$ErrorActionPreference = "Stop" | |
$sec_protocols = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::SystemDefault | |
$sec_protocols = $sec_protocols -bor [Net.SecurityProtocolType]::Tls12 | |
[Net.ServicePointManager]::SecurityProtocol = $sec_protocols | |
$url = "https://github.com/ansible/ansible/raw/devel/examples/scripts/ConfigureRemotingForAnsible.ps1" | |
Invoke-Expression ((New-Object Net.WebClient).DownloadString($url)) | |
exit | |
delegate_to: localhost |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment