ansible管理win10

设置Windows远端管理(WS-Management,WinRM)
winrm service 默认都是未启用的状态,先查看状态;如无返回信息,则是没有启动;

winrm enumerate winrm/config/listener
#
#
#
ansible管理win10
#
#
#
针对winrm service 进行基础配置:

winrm quickconfig
#
#
ansible管理win10
#
#
ansible管理win10
#

#
ansible管理win10

#
#
#
ansible管理win10
#
#
需要把需要ansible管理的window机器调成专有网络
#
#

ansible管理win10
#
#
#

查看winrm service listener:

winrm e winrm/config/listener

#
#
#

ansible管理win10
#
#
#

为winrm service 配置auth:

扫描二维码关注公众号,回复: 4830945 查看本文章

winrm set winrm/config/service/auth @{Basic="true"}
#
#
#
ansible管理win10

#
#
#

为winrm service 配置加密方式为允许非加密:

winrm set winrm/config/service @{AllowUnencrypted="true"}
#
#
#
ansible管理win10

#
#
ansible管理win10
福利
#
#

好了,远程Windows主机配置到此结束,我们验证配置的是否有问题。

配置ansible server段host配置

#
#

ansible管理win10

#
#
192.168.0.57 ansible_ssh_user=dell ansible_ssh_pass="xxxxx" ansible_ssh_port=5985 ansible_connection="winrm"
#
#
#
#
Windows下可用模块测试
win_ping —Windows系统下的ping模块,常用来测试主机是否存活
ansible host -m win_ping

#
#
ansible管理win10
#
#

ansible管理win10

楼镇图

猜你喜欢

转载自blog.51cto.com/13386520/2340266
今日推荐