我正在通过 micheal heap 从 ansible-beginner 到 pro 学习 ansible。Windows 上似乎不支持 ansible。这本书建议改为从虚拟机运行 ansible。我使用 vagrant 启动了一个 VMbox,上面有 ubuntu/trusty64。我能够成功地在它上面运行我的剧本。但是,我在创建 ansible-galaxy 角色时遇到了问题。
我找不到在 Windows 上创建/初始化角色的方法。我从这个问题中模糊地借用了想法如何自动安装 Ansible Galaxy 角色?并将以下命令添加到我的剧本中在 Windows 上创建角色
local_action: command ansible-galaxy init sush.util --init-path roles
---
- hosts: all
gather_facts: false
become: true
tasks:
- name: make sure we can connect
ping:
#ansible-galaxy
- name: Init sush.util
local_action: command ansible-galaxy init sush.util --init-path roles
ignore_errors: true
ignore_errors=true
如果角色已经创建,我还添加了忽略错误。这是正确的方法还是在 Windows 中有另一种/更好的方法?