欢迎光临南昌笑劳网络科技有限公司,我们是一家专注中小型企业营销推广服务的公司!

咨询热线:400 76543 55
南昌笑劳网络科技有限公司
最新资讯News
南昌笑劳网络科技有限公司

详细介绍Windows下如何使用Ansible应用的实例

作者:黄舟 | 点击: | 来源:黄舟
0706
2017
这个其实也不算是错误,只需要求改网络的属性:在网络和共享中心中把公共网络,切换成家庭网络...

环境需求:

* Controller 一定要是 Linux 

* Windows  需要:

    1.Framework 4.5

    2.PowerShell 3.0

原料:

    Ansible Master (CentOS)

    Anisble Slave (Windows SP1)

步骤:

    [Linux]

yum -y install python-kerberos.x86_64 python2-winrm.noarch

        [Windows]

下载 Framework 4.5

http://download.microsoft.com/download/B/A/4/BA4A7E71-2906-4B2D-A0E1-80CF16844F5F/dotNetFx45_Full_x86_x64.exe

    下载 PowerShell 3.0

https://download.microsoft.com/download/E/7/6/E76850B8-DA6E-4FF5-8CCE-A24FC513FD16/Windows6.1-KB2506143-x64.msu

 安装完成后会重启一次

    下载 Remoting Script for Ansible

https://github.com/ansible/ansible/blob/devel/examples/scripts/ConfigureRemotingForAnsible.ps1

  使用管理员身份运行脚本

    使用管理员身份打开PowerShell 

winrm qc

 会出现以下错误

    这个其实也不算是错误,只需要求改网络的属性:在网络和共享中心中把公共网络,切换成家庭网络

    再次执行

winrm qc

    接下来需要开启windows 远程操作的相关属性:

winrm set winrm/config/service '@{AllowUnencrypted="true"}'
winrm set winrm/config/service/auth '@{Basic="true"}'

    以上就可以看到端口5985 已经起来了

    netstat -ano | findstr 5985

    使用ansible 测试windows 主机

cat /etc/ansible/hosts

[windows]

10.0.50.100 ansible_ssh_user="Administrator" ansible_ssh_pass="123456" ansible_ssh_port=5986 ansible_connection="winrm"


# windows  # CCE  # microsoft  # 起来了  # 安装完成后  # 中把  # 就可以  # 重启  # 只需  # 也不  # download 

我要咨询做网站
成功案例
建站流程
  • 网站需
    求分析
  • 网站策
    划方案
  • 页面风
    格设计
  • 程序设
    计研发
  • 资料录
    入优化
  • 确认交
    付使用
  • 后续跟
    踪服务
  • 400 76543 55
    sale#ncxiaolao.cn
Hi,Are you ready?
准备好开始了吗?
那就与我们取得联系吧

咨询送礼现在提交,将获得笑劳科技策划专家免费为您制作
价值5880元《全网营销方案+优化视频教程》一份!
下单送礼感恩七周年,新老用户下单即送创业型空间+域名等大礼
24小时免费咨询热线400 76543 55
合作意向表
您需要的服务
您最关注的地方
预算

直接咨询