栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

ansible管理windows2019

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

ansible管理windows2019

需求

配置winrm之前检查系统版本,以及powershell版本,如果是Server2008R2版本,则需要升级powershell至4.0版本。Server2012R2以上的版本不需要升级powershell。

# ansible服务端
pip install pywinrm

开启winrm
#检查powershell版本
get-host
#查看poweshell执行策略
get-executionpolicy
#更改powershell执行策略为remotesigned
cmd "/c echo A|powershell set-executionpolicy remotesigned"
#配置winrm service并启动服务
cmd "/c echo y|powershell winrm quickconfig"
#查看win service的启动监听状态
winrm enumerate winrm/config/listener
#修改winrm配置,启用远程连接认证
winrm set winrm/config/service/auth '@{Basic="true"}'
winrm set winrm/config/service '@{AllowUnencrypted="true"}'

配置hosts
[windows]
x.x.x.x
[windows:vars]
ansible_ssh_user="Administrator"
ansible_ssh_pass="SG47@5fh49Ss"
ansible_connection="winrm&

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/850663.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号