ansible管理win10
2021-06-21 10:05
标签:int image list package reject ecif kconfig sts spec winrm enumerate winrm/config/listener winrm quickconfig # # 查看winrm service listener: winrm e winrm/config/listener # 为winrm service 配置auth: winrm set winrm/config/service/auth @{Basic="true"} # 为winrm service 配置加密方式为允许非加密: winrm set winrm/config/service @{AllowUnencrypted="true"} # 好了,远程Windows主机配置到此结束,我们验证配置的是否有问题。 配置ansible server段host配置 # # # # 楼镇图 ansible管理win10 标签:int image list package reject ecif kconfig sts spec 原文地址:http://blog.51cto.com/13386520/2340266
winrm service 默认都是未启用的状态,先查看状态;如无返回信息,则是没有启动;
#
#
#
#
#
#
针对winrm service 进行基础配置:
#
#
#
#
#
#
#
#
#
需要把需要ansible管理的window机器调成专有网络
#
#
#
#
#
#
#
#
#
#
#
#
执行后查看window上5985端口是否开启
#
#
#
#
#
#
#
#
#
#
#
福利
#
#
#
#
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
#
#
#
#
#
TASK [setup] ***
fatal: [192.168.0.57]: UNREACHABLE! => {"changed": false, "msg": "plaintext: HTTPConnectionPool(host=‘192.168.0.57‘, port=5985): Max retries exceeded with url: /wsman (Caused by NewConnectionError(‘
当出现这种情况说明你的window服务器winrm没有开启
#
#
#
#
fatal: [192.168.0.57]: UNREACHABLE! => {
"changed": false,
"msg": "plaintext: the specified credentials were rejected by the server",
"unreachable": true
}
#
#
当出现这种情况是你网络模式不是专有网络或者window用户权限的问题
#
#
上一篇:WPF 流加载