3

每当我在存储库中更改我的 Ansible 角色中的代码时,我还希望在我的测试机器上的角色目录中更新该代码。我为获得新代码所做的是

  1. 通过运行删除角色ansible-galaxy remove rolename
  2. 通过使用再次安装角色ansible-galaxy install git+https://url/rolename

如果我在install之前不使用remove选项,ansible-galaxy 会跳过已经安装的角色。它不会在 repo 中看到更改的文件。

实现这一目标的最佳方法是什么?

4

1 回答 1

0

似乎更新角色的推荐路径是使用该--force选项。

ansible-galaxy install --help

  -f, --force           Force overwriting an existing role or collection

作为参考,还可以在他们的存储库中查看那些喜欢的内容:

所以在你的情况下

ansible-galaxy install --force git+https://url/rolename
于 2020-11-27T12:16:15.357 回答