


Environment requirements:
* Controller must be Linux
* Windows Requirements:
1.Framework 4.5
2.PowerShell 3.0
Materials:
Ansible Master (CentOS)
Anisble Slave (Windows SP1)
Steps:
[Linux ]
yum -y install python-kerberos.x86_64 python2-winrm.noarch
[Windows]
Download Framework 4.5
http://download.microsoft.com/download/B/A/4/BA4A7E71-2906-4B2D-A0E1-80CF16844F5F/dotNetFx45_Full_x86_x64.exe
Download PowerShell 3.0
https://download.microsoft.com/download/E/7/6/E76850B8-DA6E-4FF5-8CCE-A24FC513FD16/Windows6.1-KB2506143-x64.msu
After the installation is complete, it will restart once
Download Remoting Script for Ansible
https://github.com/ansible/ansible/blob/devel/examples/scripts/ConfigureRemotingForAnsible.ps1
Run the script as an administrator
Open PowerShell as an administrator
winrm qc
The following error will appear
This In fact, it is not an error. You only need to change the network properties: switch the public network to the home network in the Network and Sharing Center
Execute again
winrm qc
Next, you need to enable Windows remote operation Related attributes:
winrm set winrm/config/service '@{AllowUnencrypted="true"}'
winrm set winrm/config/service/auth '@{Basic="true"}'
Above you can see that port 5985 is up
netstat -ano | findstr 5985
Use ansible to test the windows host
cat /etc/ansible/hosts
[windows]
10.0.50.100 ansible_ssh_user="Administrator" ansible_ssh_pass="123456" ansible_ssh_port=5986 ansible_connection="winrm"
The above is the detailed content of Detailed examples of how to use Ansible applications under Windows. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

WebStorm Mac version
Useful JavaScript development tools

Atom editor mac version download
The most popular open source editor

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software