摘要:本文主要向大家介绍了Windows运维之使用ansible安装windows软件包,通过具体的内容向大家展现,希望对大家学习Windows运维有所帮助。
本文主要向大家介绍了Windows运维之使用ansible安装windows软件包,通过具体的内容向大家展现,希望对大家学习Windows运维有所帮助。
支持exe软件包的ansible模块,搜集了2个:win_package (本次使用这个)官方文档://docs.ansible.com/ansible/latest/modules/win_package_module.htmlwin_chocolatey官方文档://docs.ansible.com/ansible/latest/modules/win_chocolatey_module.html
以安装vc2013(32位)软件包vcredist_x86.exe为例:
由于win_package模块需要product_id,所以需要先确认product_id,查找位置:32位程序:HKLM:Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall64位程序:HKLM:Software\Microsoft\Windows\CurrentVersion\Uninstall注:HKLM为HKEY_LOCAL_MACHINE的缩写
手动安装vcredist_x86.exe,得到product_id:{13A4EE12-23EA-3371-91EE-EFB36DDFFF3E}
编写playbook
[root@xxx ~]# cat vc.yaml
---
- name: Install vc
gather_facts: False
hosts: all
tasks:
- name: install vc 2013
win_package:
path: D:\upload\vcredist_x86.exe
product_id: ‘{13A4EE12-23EA-3371-91EE-EFB36DDFFF3E}‘
arguments: /install /passive /norestart
执行playbookansible-playbook vc.yaml
本文由职坐标整理并发布,希望对同学们有所帮助。了解更多详情请关注系统运维windows频道!
您输入的评论内容中包含违禁敏感词
我知道了
请输入正确的手机号码
请输入正确的验证码
您今天的短信下发次数太多了,明天再试试吧!
我们会在第一时间安排职业规划师联系您!
您也可以联系我们的职业规划师咨询:
版权所有 职坐标-一站式IT培训就业服务领导者 沪ICP备13042190号-4
上海海同信息科技有限公司 Copyright ©2015 www.zhizuobiao.com,All Rights Reserved.
沪公网安备 31011502005948号