1、添加认证方式
2、创建项目,选择以winrm python方式,并选中认证方式
3、在rundeck服务器上安装pywinrm和request模块
pip install pywinrm && pip install requests
报错
-bash: pip: command not found
解决:
1、下载
wget https://bootstrap.pypa.io/get-pip.py
2、安装
python get-pip.py
3、查看pip版本(如果本步骤正常,忽略4/5步)
pip -V
4、查找pip安装路径
find / -name pip
5、将pip添加到系统命令
ln -s /usr/local/python/bin/pip /usr/bin/pip
pip install pywinrm && pip install requests
3、编辑node节点并编辑xml文件
<?xml version="1.0" encoding="UTF-8"?>
<project>
<node name="windows" description="Windows node" tags="" hostname="10.0.0.11" osArch="x86" osFamily="windows" osName="Windows 2016" osVersion="2016" username="administrator" winrm-protocol="http" winrm-auth-type="basic" winrm-cmd="CMD" winrm-password-storage-path="keys/alipassword"/>
</project>
4、windows配置服务
为winrm service 配置auth:
winrm set winrm/config/service/auth @{Basic=“true”}
为winrm service 配置加密方式为允许非加密:
winrm set winrm/config/service @{AllowUnencrypted=“true”}
5、命令行测试下命令