Ansible批量远程管理Windows主机(部署与配置)
一、Linux管理服务器需安装pip、pywinrm插件
(1)配置阿里镜像源
[root@HJM Desktop]# cd /etc/yum.repos.d/
[root@HJM yum.repos.d]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
[root@HJM yum.repos.d]# sed -i ‘s/$releasever/7/’ CentOS-Base.repo
[root@HJM yum.repos.d]# yum clean all
(2)安装ansible软件包
[root@HJM ~]# yum install - y ansible
(3)安装pip和pywinrm
[root@HJM ~]# yum install -y epel-release
[root@HJM ~]# yum install python-pip
[root@HJM ~]# pip install pywinrm
(4)配置host文件
[root@HJM ~]# vim /etc/ansible/hosts
[win]
192.168.10.15 ansible_ssh_user=“Administrator” ansible_ssh_pass=“Linqi777” ansible_ssh_port=5985 ansible_connection=“winrm” ansible_winrm_server_cert_vali