1、window主机:
执行winrmchange.reg
执行 ConfigureRemotingForAnsible.ps1
执行:
winrm qc
winrm set winrm/config/service '@{AllowUnencrypted="true"}'
winrm set winrm/config/service/auth '@{Basic="true"}'
2、vi /etc/ansible/hosts
[lsyhymwin]
172.20.60.60 ansible_ssh_user=administrator ansible_ssh_pass="B9clgys@" ansible_ssh_port=5985 ansible_connection="winrm" ansible_winrm_server_cert_validation=ignore
3、复制文件:ansible allwin -m win_copy -a "src=/root/Zabbix3AgentSetup dest=c:\ owner=administrator"
4、执行程序:ansible allwin -m raw -a "cd c:\Zabbix3AgentSetup\bin\Debug; c:\Zabbix3AgentSetup\bin\Debug\Zabbix3AgentSetup.exe"