managing Windows Instance via Ansible

Managing windows based instance is not easy for systemadmin and devops engineer

Step for managing Windows based Instance 

1.  Launch windows 7/8 OS or  windows 2008  / 2012 / 2016  server

Requirement :  


  1.   Administrator  OR  Admin power user
  2.   PowerShell 4 or later version 
  3.   Firewall Off or  allow tcp/udp port 5985 
  4.   setup  parameter 
Setting parameter .

there are two types of method .

i)  Kerberos based 
ii)  Plaintext based method 

Note :    setting  kerberos is not easy for everyone so we are using 

Open CMD and set two  things given below.

winrm  quickconfig

press y to start winrm


  •  Nowt check  on cmd some variables 
winrm get   winrm/config/service

#  Note  set windows Auth and allowunecrypted parameter

. winrm set winrm/config/service/Auth  @{Basic="true"}
winrm set winrm/config/service  @{AllowUnencrypted="true"}


Important :   make allow rule in firewall for  5985  tcp/udp  or turn firewall


Finally Making  inventory file for Windows  :


[root@phoenix Desktop]# vim /etc/ansible/hosts
[windows]
192.168.10.222

[windows:vars]
ansible_ssh_user=Administrator
ansible_ssh_pass=redhat1234
ansible_ssh_port=5985
ansible_winrm_server_cert_validation=ignore
ansible_connection=winrm


To test use  win_ping module 

root@adhoc:~# ansible all -i /etc/ansible/windowsinventory  -m win_ping 
ok | SUCCESS => {
    "changed": false, 
    "ping": "pong"
}



Note:  according to your requirement you can check modules 

"Enjoy your learning !!"


Comments

  1. Hey thanks for this amazing post! Thank you so much for sharing the good post, I appreciate your hard work.Keep blogging.
    DevOps Training in Electronic City

    ReplyDelete
  2. Our DevOps Training in Noida incorporates *online classes, classroom sessions, real-life case studies, develop and deploy software using DevOps* and lots more.

    ReplyDelete
  3. Thanks for sharing such a great post. It is very useful and informative. Valuable information you have shared. Also, check out
    Devops Services

    ReplyDelete

Post a Comment