Learn How to Use Ansible to Manage Windows Servers (winrm) - Step by Step Guide

preview_player
Показать описание


* Certificate/Kerberos authentication:
If you'd like to use domain certificates on Windows and authenticate using Kerberos over HTTPS, get in touch. I'm not able to demo that process on YouTube but I've done it many times for various companies I've worked at. I can make myself available for a few days consulting if this is of interest.

---

------
This is a real-time demo of how to set up your windows servers so they can be managed by ansible.
-----
GIST Document (cut&paste1):
------
------

The following is covered by this demo:

• Setup a windows 2016 server so ansible can manage it (over HTTPS)
• Setup my Centos 8 server so it can manage windows servers using winrm
• Create an inventory file to hold the windows connection variables
• Prove the connection with win_ping
• Create a basic ansible playbook to manage directory’s, files (templates), md5checksum & updates.
• Use ansible-vault to hide the password from the inventory file

AnsibleDocs:
Setup Windows:
For Windows 2016, change the default powershell TLS version to TLS v1.2 with this powershell command:

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

Linux WinRM setup:

Windows module links:

Protect sensitive variables:

#Windows #Ansible #automation
Рекомендации по теме
Комментарии
Автор

This is indeed a crisp and to the point video.

syfond
Автор

That’s it for me. Life will never be the same after this video

Nimitz_oceo
Автор

Probably a next video on Chocolatey for managing software as well over Windows servers would be perfect!

seeyouagainv
Автор

Hi, I'm constantly receiving "msg": "winrm or requests is not installed: No module named 'winrm" error. I tried to install pywinrm multiple times. Please help.

hhtgltv
Автор

The problem is, we would not want to RDP to the machine and make those changes and be able to just spin up 100s and 1000s of VMs and just run ansible to configure them. If these cannot be eliminated, then probably we would have to make these changes during packer phase to have an image with these settings you made in powershell already in place, and then build all the machine based off of that image.

SuperheroKaif
Автор

Thanks. it was very helpful. I have setup the Ansible according to your video and there is no issue, but with Ansible tower, I am not getting it through, I don't know, how to link the host and ansible.cfg with Ansible Tower. When I run the template, I get an error that the host can not be reached. Any advice?

hugecoks
Автор

How would you change IP settings of multiple windows server (2019/2022) vms with ansible?

Автор

Great instructions! Thanks. if i have multiple groups on the hosts file, such as [win], [linux], [routers] etc, I created each yml file, win.yml, linux.yml, routers.yml, tried to encrypt password for each group using ansible-vault encrypt_string 'Administrator/root _user_password' --name ansible_password
unless the passwords are same. it does not seem to work. How could I make it work. Thank you.

daye
Автор

Hi Dennis,

I’m getting this error {“msg”:”winrm or requests is not installed: cannot import name certs”} can you please tell me what should I do to fix this!!

Blue-mddu
Автор

have you written any windows server hardening playbooks? updating TLS 1.1 to 1.2 and Updating latest SSL...etc?

aap
Автор

Is it possible to control and launch the ansible playbook from vscode to windows?

inesalmeida
Автор

Do you have a video that use packer and ansible to create customer windows image

joeb.
Автор

Strangely don't see the script to setup the http and https listener anymore in the documentation, so winrm enumerate winrm/config/Listener shows nothing... is there another way to go about it ?

darwaydrum
Автор

what is that black window..how did you jump on

KiranKumar-jmkk
Автор

The PS script from the first step does not exist anymore, can you please refer how should this be handled or refer a link of the same step, I am a little confused atm. Thank you.

dzannamolly
Автор

Sorry but you skipped over some things I am currently stuck on, even going through documentation I am still having trouble. For instance where did you get that username and password at 0:35? Also, after running the commands at 1:45, I only see one http block, there is no second block for https. This is causing my ansible connection to my windows instance to fail. After reviewing documentation, I need to set up certificates for https connection??? this is very confusing and not working for me, but thanks any way for the vid as it helped me with other areas.

benjamn
Автор

This doesn't seem to work anymore on AWS. Only the HTTP listener is running not the HTTPS

TechTasteDaily