我正在编写一个简单的剧本,最终能够启动/停止/重新启动 Windows 服务,但我遇到了一个问题:
fatal: [mspdbwn1w01]: FAILED! => {
"msg": "The powershell shell family is incompatible with the sudo become plugin"
}
Run Code Online (Sandbox Code Playgroud)
以下是剧本:
- name: Add Host
hosts: localhost
connection: local
strategy: linear
tasks:
- name: Add Temp Host
add_host:
name: "{{ win_client }}"
group: temp
- name: Target Server
connection: winrm
hosts: temp
tasks:
- name: Stop a service
win_service:
name: "{{ service }}"
state: stopped
Run Code Online (Sandbox Code Playgroud)
谷歌并没有提供太多帮助,我已经尝试了我能找到的一切,become*的每一个变体。
我不知道这是否重要,但由于我工作环境的性质,我有 2 个单独的用户登录 *nix 主机和 windows 主机。
任何帮助或指导将不胜感激。