Ansible Windows Host: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
| Zeile 23: | Zeile 23: | ||
ansible_password=r$eBQNgc5U&A2at8kDwpWo.KzLT5NvHd | ansible_password=r$eBQNgc5U&A2at8kDwpWo.KzLT5NvHd | ||
ansible_winrm_server_cert_validation=ignore | ansible_winrm_server_cert_validation=ignore | ||
| + | |||
| + | |||
| + | *ansible_connection=winrm to define the connection is not SSH should use winrm | ||
| + | *ansible_user what ever the username you have created in the windows machine | ||
| + | *ansible_password password for that user ( the same one you use for RDP) | ||
| + | *ansible_winrm_server_cert_validation this is fine in DEV/TEST environment to tell ansible to ignore hostkey/server cert validation. | ||
Version vom 18. Januar 2022, 14:36 Uhr
Host
Install WinRM
- Ansible Team stellt Script für Installation zur Verfügung
iex(iwr https://raw.githubusercontent.com/ansible/ansible/devel/examples/scripts/ConfigureRemotingForAnsible.ps1).Content
- Nach dem Erfolgreichen Durchlauf des Scriptes sollte WinRM auf dem Port 5986 laufen.
netstat -anp|findstr 5986
Ansible Rechner
Installation
- Installation des Python3 Packetes Pywinrm mit dem Packetmanager Pip
pip3 install pywinrm
- Kontrolle ob die Verbindung zum Windows Host funktioniert
nc -w 3 -v <remote windows server ip/hostname> 5986 (or) telnet <remote windows server ip/hostname>:5986
Ansible Hosts Inventory File
- Beispiel Host File
[win] 192.9.12.122 [win:vars] ansible_connection=winrm ansible_user=administrator ansible_password=r$eBQNgc5U&A2at8kDwpWo.KzLT5NvHd ansible_winrm_server_cert_validation=ignore
- ansible_connection=winrm to define the connection is not SSH should use winrm
- ansible_user what ever the username you have created in the windows machine
- ansible_password password for that user ( the same one you use for RDP)
- ansible_winrm_server_cert_validation this is fine in DEV/TEST environment to tell ansible to ignore hostkey/server cert validation.