Тёмный

Setup WinRM for Ansible with Certificate Authentication in 8 Easy Steps 

DevOpsLab
Подписаться 223
Просмотров 8 тыс.
50% 1

Опубликовано:

 

1 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 52   
@daevski
@daevski 4 года назад
I'm not going to lie, this video is brilliant. It's so incredibly helpful, thank you for taking the time to create and share it. Topics like this don't have enough online support to help the tech industry become knowledgeable of these topics. This is very precise, and looks to cover all the steps needed. Great Job!
@devopslab3942
@devopslab3942 4 года назад
Appreciate the support David.
@sunnybhatia6264
@sunnybhatia6264 2 года назад
Thank You very much for this video.I like it. But while working I am facing one error while running create_ansible_user.ps1. it says New-Item : The WINRM certificate mapping configuration operation cannot be completed because the user credentials could not be verified. Please check the username and password used for mapping this certificate and verify that it is a non-domain account and try again. Can you help?
@totallynotkevin4466
@totallynotkevin4466 Год назад
aye man I know its 1 year later but im facing the same issue, did you manage to get it working?
@jonathanvieyra567
@jonathanvieyra567 10 месяцев назад
@@totallynotkevin4466 to get it to work I had to move line 25: Get-LocalUser -Name $ansibleRunnerUsername | Add-LocalGroupMember -Group 'Administrators' to the end of the script. Not sure if that is the cause for your error but might be worth a shot. By any chance did you get this working?
@TheTechy103
@TheTechy103 2 года назад
Thank you for this! Very useful. One question, can you use a domain ID instead of a local account?
@alexbmw100
@alexbmw100 2 месяца назад
Amazing, very help for me, testing in homolog, successfully, thanks.
@stormalfsummonerswar3476
@stormalfsummonerswar3476 3 года назад
many thanks very clear detailed and useful. Now ansible on wsl2 works well with windows using winrm and ssl certificate!
@nimishchandra2188
@nimishchandra2188 3 года назад
Hello I have done all the step successfully but somehow i am able to connect getting ""msg": "certificate: the specified credentials were rejected by the server", "unreachable": true " please help.
@devopslab3942
@devopslab3942 3 года назад
Sometimes it is a permissions issue with the user that you have created to connect. To validate, add the user on the server to admin and try to connect again. If not, let me know if you have more logs and ill try to help
@harishmaddisetti751
@harishmaddisetti751 3 года назад
@@devopslab3942 I'm also getting same error. the user is added to administrator. I deleted and add it back but no luck
@devopslab3942
@devopslab3942 3 года назад
Could you provide a bit more details. The complete error and after what step do you get that?
@harishmaddisetti751
@harishmaddisetti751 3 года назад
@@devopslab3942 Followed the scripts in your github with change in username as ansible instead of ansiblerunner. Changed everywhere in script I got below error "changed": false, "msg": "certificate: the specified credentials were rejected by the server", "unreachable": true Below variables used ansible_user=ansible ansible_connection=winrm ansible_winrm_transport=certificate ansible_winrm_cert_pem=path/cert.pem ansible_winrm_cert_key_pem=path/cert_key.pem ansible_port=5986 ansible_winrm_scheme=https ansible_winrm_server_cert_validation=ignore
@devopslab3942
@devopslab3942 3 года назад
Can you confirm that you ran the update_firewall.ps1 script as well
@wardevley
@wardevley 3 года назад
Hello you can help me with authentication using Kerberos (Using Active Directory on Windows)?
@devopslab3942
@devopslab3942 3 года назад
I have done it but it is not covered in this video. Is there a particular issue that you are stuck on?
@_oly_241
@_oly_241 2 года назад
Probably the best video I have seen on this topic..thanks
@ariprince7993
@ariprince7993 3 года назад
Pretty impressive tutorial, but am having an issue with script 6 creating winrm https listener. Could you please help me to solve this problem?
@devopslab3942
@devopslab3942 3 года назад
Sure. If you can provide a bit more detail on the issue, I will have a look into it
@ariprince7993
@ariprince7993 3 года назад
@@devopslab3942 Hi Sir, thanks for the reply. I renamed the scripts and path and user user from ansiblerunner just to ansible but here is my setup: alll other scripts work fine -windows2012R2, clean install and fully updated -powershell: Major Minor Build Revision ----- ----- ----- -------- 5 1 14409 1005 New-WSManInstance : Object reference not set to an instance of an object. At C:\ansible_winrm_cert\5_create_winrm_listener.ps1:34 char:9 + $null = New-WSManInstance @newWsmanParams + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [New-WSManInstance], NullReferenceException + FullyQualifiedErrorId : System.NullReferenceException,Microsoft.WSMan.Management.NewWSManInstanceCommand Side note: ive noticed the script from git is missing the "Write-Host $serverCert" showing on the video, so i just added it on my side.
@devopslab3942
@devopslab3942 3 года назад
@@ariprince7993 I debugged it and found that there was an error in my script for the location of the server cert. I have updated the script in the git repo and it should be good. Also while working on windows 2012, I discovered that you might need to install the Microsoft.Powershell.LocalAccounts module that comes as part of the Windows Management Framework (WMF) v5.1 that can be downloaded from : www.microsoft.com/en-us/download/details.aspx?id=54616. The package required is Win8.1AndW2K12R2-KB3191564-x64. Let me know if everything works for you!
@ariprince7993
@ariprince7993 3 года назад
@@devopslab3942 Thank you Sir, i will try it out and let you know.
@ariprince7993
@ariprince7993 3 года назад
@@devopslab3942 Hi Sir i hope your doing well, few notes here. All the scripts works fine, but need to do a small update on the "generate_client_cert.sh" or "import_client_cert.ps1". The generate_client_cert.sh will create "client_cert.pem" and "client_key.pem" but on the "import_client_cert.ps1" will look for "cert.pem" After running the scripts i did the checks like on the video at 6:40, but your results were "Connection to host_ip_x 5986 port [tcp/wsmans] succeeded!" mine are "Connection to host_ip_x 5986 port [tcp/*] succeeded! i dont think this one is a show stopper, but am just wondering why. And last thing am getting this error on the ping test. host_ip_x | UNREACHABLE! => { "changed": false, "msg": "certificate: the specified credentials were rejected by the server", "unreachable": true } My PS Version: Name Value ---- ----- PSVersion 5.1.14409.1018 PSEdition Desktop PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...} BuildVersion 10.0.14409.1018 CLRVersion 4.0.30319.42000 WSManStackVersion 3.0 PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1
@cmanigsaca
@cmanigsaca 2 года назад
Is it possible to use only 1 certificate for all my windows servers? That way I do not have to generate and signed each one of them. I have about 100+ servers so it can be a bit difficult to maintain.
@devopslab3942
@devopslab3942 2 года назад
Yes it is possible. You should comment out the code in the script to generate the windows cert and instead just place the cert with the same name and location required by the others.
@cmanigsaca
@cmanigsaca 2 года назад
@@devopslab3942 do you have a sample links?, i would also like to use the credssp combined with CA certificate.
@taiphamquy2102
@taiphamquy2102 4 года назад
Hey bro, can you help me ? Why I have an issue at step 6 ? Error: the winrm client cannot process the request. the certificate structure was incomplete Thanks a lot
@devopslab3942
@devopslab3942 4 года назад
Hey Tai. I can't really tell the issue just from that error. Its pretty generic. However, i ran into a similar issue twice. First, when the certificates i generated were of the incorrect type. And second, when the thumbprint being used was incorrect. I suggest you edit the script to use the exact cert you want to use just to be sure. The find operation sometimes can cause issues
@taiphamquy2102
@taiphamquy2102 4 года назад
@@devopslab3942 may I have your telegram or facebook, so we can talk easily
@devopslab3942
@devopslab3942 4 года назад
@@taiphamquy2102 Sure. You can add me at facebook.com/devops.solver.5/
@faridnasiri1
@faridnasiri1 3 года назад
Thanks for excellent article and video . what could be the reason of this error ?the server is pingable . fatal: [chq-dsctest.abcd..com]: UNREACHABLE! => {"changed": false, "msg": "certificate: HTTPSConnectionPool(host='chq-dsctest.abcd..com', port=5986): Max retries exceeded with url: /wsman (Caused by ProxyError('Cannot connect to proxy.', error('Tunnel connection failed: 403 Forbidden',)))", "unreachable": true}
@devopslab3942
@devopslab3942 3 года назад
Hi Farid. Appreciate the feedback. As for the error, I have seen that when I have using an http proxy. There are settings to be done in pywinrm for making ansible proxy aware or you could work on the winrm side to configure it. Since I'm not aware of you exact setup, I can't be more specific. Hope this helps!
Далее
Securing WinRM over HTTPS [Windows Server 2019]
26:44
Configure a Windows Host for Ansible - ansible WinRM
18:13
Вопрос Ребром - Серго
43:16
Просмотров 1,4 млн
Teeth gadget every dentist should have 😬
00:20
Просмотров 1,6 млн
Обменялись песнями с POLI
00:18
Просмотров 260 тыс.
Coolify Crash Course | Self Host 101 | Secure Set up
1:29:06
Ansible for the Windows Admin by Jeremy Murrah
1:40:09
Просмотров 41 тыс.
This web UI for Ansible is so damn useful!
20:07
Просмотров 483 тыс.
Using Ansible to automate your Laptop and Desktop configs!
1:08:27
Quick and Easy Local SSL Certificates for Your Homelab!
12:08
Ansible Best Practices  Roles and Modules
1:04:24
Просмотров 21 тыс.
Ansible - Setting up kerberos authentication
11:05
Просмотров 10 тыс.
Вопрос Ребром - Серго
43:16
Просмотров 1,4 млн