部署ansible自动化运维工具-控制Windows系统-和linux系统流程

193 字
1 分钟
部署ansible自动化运维工具-控制Windows系统-和linux系统流程

部署ansible#

1.安装ansible、被控主机需要安装python、windows需要配置客户端winrm#

1.ansible#

cat ansible.cfg(简易文件)#

    [defaults]

    host_key_checking = false  #不检测密钥

    inventory = inventory

主机清单#

cat inventory#

[l_server]   #linux系统

ip地址 ansible_ssh_user=root ansible_ssh_pass=‘密码’ ansible_ssh_port=端口

[w_server]   #windows系统

ip地址 ansible_user=administrator ansible_password=密码 ansible_connection=winrm ansible_winrm_server_cert_validation=ignore  ansible_port=5985

windows系统配置#

    需要powershell4.0以上(winserver2012以上)

    get-executionpolicy 查看powershell运行策略 Restricted才可以

    更改策略: set-executionpolicy remotesigned

配置客户端winrm:#

    winrm quickconfig                                                 开启winrm服务

    winrm set winrm/config/service/auth  ’@{Basic=“true”}’            启动远程连接认证

    winrm set winrm/config/service  ’@{AllowUnencrypted=“true”}’      启动远程连接认证

文章分享

如果这篇文章对你有帮助,欢迎分享给更多人!

部署ansible自动化运维工具-控制Windows系统-和linux系统流程
https://aiyw.top/posts/bu-shu-ansible-zi-dong-hua-yun-wei-gong-ju-kong-zhi-windows/
作者
LiPeng
发布于
2025-11-04
许可协议
CC BY-NC-SA 4.0
Profile Image of the Author
LiPeng
运维工程师 · 可观测性 / 系统迁移 / 容器编排
公告
记录可观测体系、系统迁移、容器编排的实战复盘;「学习」里是 K8s 四周课程笔记。
分类
标签
站点统计
文章
31
分类
5
标签
58
总字数
59,760
运行时长
0 天
最后活动
0 天前
文章目录