Ansible-windows-lab-setup (where ansible server is in linux and target node is in windows)
Ansible is installed in linux server and target nodes are windows
need to control the target windows nodes
dependencies:
while launching windows nodes in AWS cloud
5985 and 5986 port number should need to open
these are winrm port number
in ansible server need to install “” pywinrm””
yum install python-pip -y
pip install pywinrm
** very important note**
powershell 3.0 version and .net 4 should need to installed in target windows node
[windows]
35.**.**.**
52.*.**.***
[windows:vars]
ansible_user=Administrator
ansible_password=********
ansible_port=5986
ansible_connection=winrm
ansible_winrm_server_cert_validation=ignore
these are vars
or this way
ansible_user: Administrator
ansible_password: ********
ansible_port: 5986
ansible_connection: winrm
ansible_winrm_server_cert_validation: ignore
– hosts: linux
gather_facts: true
tasks:
– name: create a file in target node1and2
file:
path: /home/devops/{{ item }}
state: touch
with_items:
– one.html
– two.html
– three.py
– four.cs
– hosts: windows
gather_facts: true
tasks:
– name: create a folder in target windowsnode1 and node2
win_file:
path: C:Temp
state: directory
source
Leave us a comment Cancel reply
COMMON QUESTIONS
Categories
- Agile Coach
- ARTIFICIAL INTELLIGENCE
- Block chain
- Business Analyst BA
- DATA science
- Development
- Devops Automation
- Dotnet
- Education
- Free Job training and assistance
- Information
- Infrastructure automation
- Interview questions
- JAVA
- jobs
- Learn
- Machine learning
- Python Automation
- QA Automation
- RPA Automation
- SAP crm
- Scrum master Agile
- Skill
- UI Design
- Uncategorized
5 Comments
Alan John Heslop
May 17, 2022 07:02 amport 6986 is wrong at minute 0:20
Jithendra Gunuru
May 17, 2022 07:02 amConnection timeout comming sir
ArcticViper
May 17, 2022 07:02 amWorks great, thank you.
Yashasvi Devang
May 17, 2022 07:02 amSir…please reply
Yashasvi Devang
May 17, 2022 07:02 amHi Vishwa- Tech
I'm Yashaswini here
I have a doubt .. could you please help.
I'm done with all initial set-ups. But still Ping is not successful.
what can be done??