Slide 1
Most trusted JOB oriented professional program
DevOps Certified Professional (DCP)

Take your first step into the world of DevOps with this course, which will help you to learn about the methodologies and tools used to develop, deploy, and operate high-quality software.

Slide 2
DevOps to DevSecOps – Learn the evolution
DevSecOps Certified Professional (DSOCP)

Learn to automate security into a fast-paced DevOps environment using various open-source tools and scripts.

Slide 2
Get certified in the new tech skill to rule the industry
Site Reliability Engineering (SRE) Certified Professional

A method of measuring and achieving reliability through engineering and operations work – developed by Google to manage services.

Slide 2
Master the art of DevOps
Master in DevOps Engineering (MDE)

Get enrolled for the most advanced and only course in the WORLD which can make you an expert and proficient Architect in DevOps, DevSecOps and Site Reliability Engineering (SRE) principles together.

Slide 2
Gain expertise and certified yourself
Azure DevOps Solutions Expert

Learn about the DevOps services available on Azure and how you can use them to make your workflow more efficient.

Slide 3
Learn and get certified
AWS Certified DevOps Professional

Learn about the DevOps services offered by AWS and how you can use them to make your workflow more efficient.

previous arrow
next arrow

Ansible Connection Options for windows remote Server

ansible-error
Spread the Knowledge

Error – Failed to connect to the host via ssh

[root@ip-172-31-12-86 ansible]# ansible all -i inventory -m win_ping
13.233.160.153 | UNREACHABLE! => {
    "changed": false,
    "msg": "Failed to connect to the host via ssh: ssh: connect to host 13.233.160.153 port 22: Connection refused",
    "unreachable": true
}

Solution – You need to set ansible_connection=winrm to connect to windows


[windows]
13.233.160.153
[windows:vars]
ansible_connection=winrm

Error – auth method ssl requires a username

[root@ip-172-31-12-86 ansible]# ansible all -i inventory -m win_ping
13.233.160.153 | UNREACHABLE! => {
    "changed": false,
    "msg": "ssl: auth method ssl requires a username",
    "unreachable": true
}

Solution – You need to set ansible_user and ansible_password to connect to windows remote


[windows]
13.233.160.153
[windows:vars]
ansible_connection=winrm
ansible_user=administrator
ansible_password=”w$y%O.ubjQhQhfa&ME@5=TeEd4Yhfy”

ansible_winrm_scheme=http
ansible_winrm_scheme=https
#Reference
https://docs.ansible.com/ansible/latest/user_guide/windows_winrm.html

Error – certificate verify failed

[root@ip-172-31-12-86 ansible]# ansible all -i inventory -m win_ping
13.233.160.153 | UNREACHABLE! => {
    "changed": false,
    "msg": "ssl: HTTPSConnectionPool(host='13.233.160.153', port=5986): Max retries exceeded with url: /wsman (Caused by SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:579)'),))",
    "unreachable": true
}

Solution – You need to set ansible_winrm_transport=basic and ansible_winrm_server_cert_validation=ignore


[windows]
13.233.160.153
[windows:vars]
ansible_user=LocalUsername
ansible_password=Password
ansible_connection=winrm
ansible_winrm_transport=basic
ansible_winrm_server_cert_validation=ignore


winrm set winrm/config/client/auth '@{Basic="true"}'
winrm set winrm/config/service/auth '@{Basic="true"}'

Set-Item -Path WSMan:\localhost\Service\Auth\Basic -Value $true

winrm set winrm/config/service/auth '@{Basic="true"}'
winrm set winrm/config/service '@{AllowUnencrypted="true"}'



ansible_user=Administrator
ansible_password=Raju$123456
ansible_connection=winrm
ansible_winrm_transport=basic
ansible_winrm_scheme=http
ansible_winrm_server_cert_validation=ignore
ansible_port=5985

Rajesh Kumar