1分钟
可用的windows模块
大多数 Ansible 模块尤其核心Ansible设计来组合 Linux/Unix 机器和任意 web services. 尽管 “windows” subcategory of the Ansible module index 列举了各种各校的 Windows 模块.
浏览上面的索引查看可用模块.
很多情况下, 其实没有必要写或者使用 Ansible 模块.
尤其, “script” 模块可以用来执行任意 PowerShell 脚本,允许 Windows administrators 组所有用户通过 PowerSehll 以非常本地化的方式做任何事情.就像如下的 playbook:
- hosts: windows
tasks:
- script: foo.ps1 --argument --other-argument注意: 有一小部分 Ansible 模块不是以 “win” 开头但依然是函数,包括 “slurp”,”raw”,和”setup”(fact 收集的工作原理).
学员评价