ansible管理windows (发送文件)
https://github.com/ansible/ansible/raw/devel/examples/scripts/ConfigureRemotingForAnsible.ps1
环境:
| 服务器端 |
python2.7 centos7 ansible yum install ansible |
| 被管理windows端 | win-server2012需要powershell 3.0 +开启winrm服务 +开启防火墙规则+配置powershell策略为remotesigned |
一、python 依赖包安装
下载pip
#wget https://bootstrap.pypa.io/get-pip.py
#python get-pip.py
安装依赖
#pip install pywinrm paramiko PyYAML Jinja2 httplib2 six
二、hosts文件配置
vim /etc/ansible/hosts
[windows]
47.107.24.1 ansible_winrm_transport=ntlm ansible_ssh_user="Administrator" ansible_ssh_pass="" ansible_ssh_port= ansible_connection="winrm" ansible_winrm_server_cert_validation=ignore
三、win 设置
# 创建目录
mkdir c:\ansible
cd c:\ansible
# 下载脚本
wget https://github.com/ansible/ansible/raw/devel/examples/scripts/ConfigureRemotingForAnsible.ps1
# 开启WinRM服务
set-ExecutionPolicy RemoteSigned
#开启防火墙端口
netsh advfirewall firewall add rule name="Win-RM-HTTP" dir=in localport=5985 protocol=TCP action=allow
四、执行命令发送文件
ansible "*" -m win_copy -a "src=/tmp/ansible_test dest=c:/ansible"
参考文档:https://www.jianshu.com/p/0ad50049adb7
ansible管理windows (发送文件)的更多相关文章
- [转帖]Ansible管理windows集群
Ansible管理windows集群 http://www.cnblogs.com/Dev0ps/p/10026908.html 写的挺好的 我关注点还是不够好呢 最近公司新项目需要安装400+win ...
- 厉害—Ansible管理windows集群
最近公司新项目需要安装400+windows server 2012系统的工作站,想着怎么能像linux下运用ansible批量管理,linux就很简单了有ssh服务 但是下却没这么简单,但还是有办法 ...
- ansible管理windows实践
一.前言 近期打算搞搞自动部署,因为是windows服务器,一些工具和系统支持都不是太好.最后发现ansible比较火,最重要的是他支持windows.本文主要就ansible 在windows使用环 ...
- ansible管理windows主机
1. 在windows开启winrm winrm service 默认都是未启用的状态,先查看状态:如无返回信息,则是没有启动: winrm enumerate winrm/config/listen ...
- Ansible 管理Windows 受控端
- Ansible学习笔记(一):部署管理Windows机器遇到的一些坑
在给国盛通上海测试环境做Ansible管理Windows服务器的时候,遇到了一些坑,Google解决掉了,特此记录,坑用红色标记. 一.环境说明 1.Ansible管理主机 操作系统:CentOS 7 ...
- [转帖]Ansible批量远程管理Windows主机(部署与配置)
2018-09-12 12:04:42 https://blog.51cto.com/7424593/2174156 一.测试环境介绍 Ansible管理主机: 系统: CentOS6.8 IP ...
- Ansible 批量管理Windows Server服务器
Ansible批量管理Windows Server Ansible是一款为类Unix系统开发的自由开源的配置和自动化工具, 它用Python写成,类似于saltstack和Puppe ...
- Ansible批量远程管理Windows主机(部署与配置)
一.测试环境介绍 Ansible管理主机: 系统: CentOS6.8 IP Addr: 172.16.10.22 Linux管理服务器需安装pip.pywinrm插件 Windows客户端主机: ...
随机推荐
- HDU 1298 T9(字典树+dfs)
http://acm.hdu.edu.cn/showproblem.php?pid=1298 题意:模拟手机9键,给出每个单词的使用频率.现在给出按键的顺序,问每次按键后首字是什么(也就是要概率最大的 ...
- 集成算法——Ensemble learning
目的:让机器学习效果更好,单个不行,群殴啊! Bagging:训练多个分类器取平均 Boosting:从弱学习器开始加强,通过加权来进行训练 (加入一棵树,比原来要强) Stacking:聚合多个分类 ...
- http协议的状态码解释
一些常见的状态码为: 200 – 服务器成功返回网页 404 – 请求的网页不存在 503 – 服务器超时 下面提供 HTTP 状态码的完整列表.点击链接可了解详情.您也可以访问 HTTP 状态码上的 ...
- 突变注释工具SnpEff,Annovar,VEP,oncotator比较分析--转载
https://www.jianshu.com/p/6284f57664b9 目前对于variant进行注释的软件主要有4个: Annovar, SnpEff, VEP(variant Effect ...
- Codeforces 786 A. Berzerk
题目链接:http://codeforces.com/problemset/problem/786/A 这个题出做$DIV2$的$C$以及$DIV1$的A会不会难了一点啊... 做法和题解并不一样,只 ...
- mongdb使用技巧
进入shell的方法:mongo 命令 # 使用系统服务启动 mongodb /etc/init.d/mongod # 或 service mongod start # 或 service mon ...
- mysql 中判断表是否存在 以及表存在则删除
select * from information_schema.tables where table_name ='student';select * from information_schema ...
- ZZNU 正约数之和 2094
#include<iostream> #include<cstring> #include<queue> #include<cstdio> #inclu ...
- vue中兄弟组件间通讯
vue2.0中兄弟组件间的通讯是通过eventBus(事件发布订阅)实现的. eventBus.js import Vue from 'vue' const eventBus = new Vue() ...
- 清理SuperMap iclient 三维插件的缓存批处理
在windows任何位置,新建一个文本文件,将下面内容复制到文本文件中并保存,然后修改该文本文件后缀为.bat,鼠标点击执行即可完成清理工作~ @echo off title 清理三维缓存 @echo ...