Windows自动化运维——ansible控制Windows安装过程

  

目录

一,必须安装在ansible的Linux管控主机上安装控制窗口的组件   1 .安才能装pywinrm, kerberos   二、配置Windows主机   1 .安才能装安装Framework  4.5(最低3.0)   2 .修才能改注册列表:设置powershell本地脚本运行权限为remotesigned   2 .才能升级到powershell - 3.0   3 .才能配置winrm   三、功能测试


下面开始…


一、配置ansible管控机器

,美元sudo  pip  install  http://github.com/diyan/pywinrm/archive/master.zip蛋=pywinrm   美元,sudo  pip  install  kerberos

在安装kerberos之前需要安装

,美元sudo  apt-get  install  libkrb5-dev

否则报错为

,美元sudo  pip  install  kerberos   running  build_ext   building  kerberos的扩展   creating 构建   creating 构建/temp.linux - x86_64 2.7   creating 构建/temp.linux - x86_64 - 2.7/src   gcc  -pthread  -fno-strict-aliasing  -DNDEBUG  -g  -fwrapv  -O2  -Wall  -Wstrict-prototypes  -fPIC  i/usr/include/python2.7  -c  src/base64.c  -o 构建/temp.linux - x86_64 2.7/src/base64.o 上海:,1:krb5-config:, not 发现   gcc:错误:,上海::,No  such  file 或是目录   gcc:错误:1::,No  such  file 或是目录   gcc:错误:,krb5-config::, No  such  file 或是目录   gcc:错误:,不是:,No  such  file 或是目录   gcc:错误:,发现:,No  such  file 或是目录   错误:,command “gcc, failed  with  exit  status  1   ----------------------------------------   Command /usr/bin/python  -c “import  setuptools __file__="/etc/ansible/脚本/构建/kerberos/setup . py”; exec(编译(开放(__file__) .read () .replace (“\ r \ n ', ' \ n '),, __file__,, '执行'))”,install ——single-version-externally-managed ——record /tmp/pip-Q3eBF1-record/install-record.txt  failed  with  error  code  1   Storing  complete  log 拷贝/home/ansible/.pip/皮普。日志


二,配置windows主机

查看系统中。净版本及powershell版本

<强>

PS  C: \ \用户ABC> psversiontable美元   Name ,,,,,,,,,,,,,,,,,,,,,,,,,,的值   - - - - -,,,,,,,,,,,,,,,,,,,,,,,,,,- - - - - -   CLRVersion ,,,,,,,,,,,,,,,,,,,,, 2.0.50727.5485   BuildVersion ,,,,,,,,,,,,,,,,,,,, 6.1.7601.17514   PSVersion ,,,,,,,,,,,,,,,,,,,,,,, 2.0   WSManStackVersion ,,,,,,,,,,,,,,,,,,, 2.0   PSCompatibleVersions ,,,,,,,,,,,,,,,,, 1.0, 2.0}   SerializationVersion ,,,,,,,,,,,,,,,, 1.1.0.1   PSRemotingProtocolVersion ,,,,,,,,,,,,,,, 2.1      PS  C: \ \用户ABC>美元主机         Name ,,,,,,,,,,,,,,: ConsoleHost   Version ,,,,,,,,,,,,,: 2.0   InstanceId ,,,,,,,,,,,, 586 e26ae - 8630 - 4 -添加- aa4c d864726f5384   UI ,,,,,,,,,,,,,,,: System.Management.Automation.Internal.Host.InternalHostUserInterface   CurrentCulture ,,,,,,,,,:应用   CurrentUICulture ,,,,,,,,:应用   PrivateData ,,,,,,,,,,,: Microsoft.PowerShell.ConsoleHost + ConsoleColorProxy   IsRunspacePushed ,,,,,,,,,,假的   Runspace ,,,,,,,,,,,,,, System.Management.Automation.Runspaces.LocalRunspace

1。安装安装框架4.5(最低3.0)

http://download.microsoft.com/download/b/a/4/ba4a7e71 - 2906 - 4 - b2d a0e1 - 80 cf16844f5f/dotnetfx45_full_x86_x64.exe


2。null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null

Windows自动化运维——ansible控制Windows安装过程