1、主控端安装ansible
        1) pip install ansible
2、主控端安装相关的包
pip install http://github.com/diyan/pywinrm/archive/master.zip#egg=pywinrm
apt-get install libkrb5-dev
pip install kerberos
         pip install paramiko PyYAML Jinja2 httplib2 six
3、配置windows
        1) 升级到.net 3.0以上
            下载链接为:http://download.microsoft.com/download/B/A/4/BA4A7E71-2906-4B2D-A0E1-80CF16844F5F/dotNetFx45_Full_x86_x64.exe。 下载至本地后双击左键安装即可,期间可能会多次重启,电脑需正常连接Internet。
        2) 升级到powershell 3.0以上
            下载链接为https://github.com/cchurch/ansible/blob/devel/examples/scripts/upgrade_to_ps3.ps1,下载后在powershell中执行就可以了
        3) 执行$host和$psversiontable查看版本,ps是$host的Version,.net是$psveriontable的CLRVersion
                
        4) 更改powershell策略为remotesigned
            set-executionpolicy remotesigned
            
            或者修改注册表HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft\PowerShell
                

        5) 在powershell中执行winrm qc启动winrm
        6) 在cmd中执行   
            > winrm set winrm/config/service '@{AllowUnencrypted="true"}'
            > winrm set winrm/config/service/auth '@{Basic="true"}'
                
4、修改ansible服务端
        1) 修改默认得到Inventory /etc/ansible/hosts,添加
            [windows]
            192.168.56.101 ansible_ssh_user="Administrator" ansible_ssh_pass="geely@2018" ansible_ssh_port=5985 ansible_connection="winrm" ansible_winrm_server_cert_validation=ignore
        2) 测试:
                ansible 192.168.56.101 -m win_ping 

Ansible 操作windows的更多相关文章

  1. ansible管理windows实践

    一.前言 近期打算搞搞自动部署,因为是windows服务器,一些工具和系统支持都不是太好.最后发现ansible比较火,最重要的是他支持windows.本文主要就ansible 在windows使用环 ...

  2. ansible控制windows的官方翻译

    Ansible控制windows 1.    Windows下如何工作 在ansible控制linux的时候,用的是ssh的方式,在windows中,使用的是power shell,在客户端机器上也是 ...

  3. [转帖]Ansible管理windows集群

    Ansible管理windows集群 http://www.cnblogs.com/Dev0ps/p/10026908.html 写的挺好的 我关注点还是不够好呢 最近公司新项目需要安装400+win ...

  4. winreg操作windows注册表详解示例

    #coding:utf-8 #=====================================================================#=====本程序演示了WINR ...

  5. C语言操作WINDOWS系统存储区数字证书相关函数详解及实例

     C语言操作WINDOWS系统存储区数字证书相关函数详解及实例 以下代码使用C++实现遍历存储区证书及使用UI选择一个证书 --使用CertOpenSystemStore打开证书存储区. --在循环中 ...

  6. C# 操作windows服务[启动、停止、卸载、安装]

    主要宗旨:不已命令形式操作windows服务 static void Main(string[] args) { var path = @"E:\开发辅助项目\WCF\WCF.Test\WC ...

  7. ansible管理windows (发送文件)

    https://github.com/ansible/ansible/raw/devel/examples/scripts/ConfigureRemotingForAnsible.ps1 环境: 服务 ...

  8. 全键盘操作Windows

    计算机机用户在使用计算机的时候,是用键盘多一点?还是用鼠标多一点?如果是专业打字员,应该会说他使用键盘多一点,除此之外,多数人都会告诉你,他已经离不开鼠标了,没有鼠标,就不会操作电脑.   如果某一天 ...

  9. 【ANSIBLE】ansible控制windows插件安装及运行error与解决方法

    一. 问:因pip版本问题无法安装kerberos 答:安装提示需要先安装pip升级包 下载pip9.0.1升级包: https://pypi.python.org/packages/b6/ac/70 ...

随机推荐

  1. OC convertRect

    举个例子: redView = [[UIView alloc]initWithFrame:CGRectMake(50, 100, 100, 100)]; redView.backgroundColor ...

  2. ubuntu 安装ftp nginx tomcat,mysql

    tomcat sudo apt-get install tomcat 访问方式,http://loclahost:8080 进入sbin目录下 sudo ./startup.sh开启 sudo ./s ...

  3. [dt]世纪历史长河年代表

    年代口诀 夏商与西周, 东周分两段, 春秋和战国, 一统秦两汉, 三分魏蜀吴, 二晋前后延, 南北朝并列, 隋唐五代传, 宋元明清后, 皇朝至此完. 中国历史长河年代表 参考: 中国历史朝代顺序表.年 ...

  4. Leetcode: Binary Tree Level Order Transversal

    Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, ...

  5. dxf cad dwg 文件读写,支持跨平台移植 库

    http://www.pudn.com/Download/item/id/3096684.html 联合开发网 --->绘图程序

  6. Python: re.compile()

    compile(pattern,flags=0) 1.编译一个正则表达式模式,返回一个模式对象 2.第二个参数flags是匹配模式,可以使用按位或‘|'表示同时生效,也可以在正则表达式字符串中指定 P ...

  7. linux centos系统下升级python版本

    本文参考资料:https://www.cnblogs.com/leon-zyl/p/8422699.html,https://blog.csdn.net/tpc1990519/article/deta ...

  8. tortoisegit 代码的回滚方式 --两种

    TortoiseGit有两种回滚代码方式, 一种是导出指定版本代码为zip格式,不影响源代码:另一种是直接在源代码上回滚, 指定版本之后写的代码都会被删除.下面分别介绍这两种方法: 首先进入版本日志对 ...

  9. vue 拨打电话

    <a v-bind:href="'tel:'+(order.orderer.phone)">{{order.orderer.phone}}</a> v-bi ...

  10. linux服务器---安装samba

    安装samba 1.检测samba是否安装,如果没有,那么可以使用yum来安装.至少需要安装3个软件:samba,samba-client.samba-common [root@localhost p ...