1

我对ansible很陌生,大约有几个小时的经验。我目前正在尝试运行一个ansible-pull命令,但它没有按我期望的方式工作。我有一个带有 .yml 文件的 git repo。在 repo 中,我只有 .yml 和 README 文件。

我正在运行的命令是:

ansible-pull -d ./ansible_directory -U github.repo

我收到一条错误消息,指出 local.yml 文件不存在。这反过来又给了我一个错误,上面写着ERROR! Could not find a playbook to run..

我不确定在哪里/如何创建 local.yml 文件。如果有人能指出我正确的方向,那将不胜感激。

4

2 回答 2

0

尝试

ansible-pull -C <branch name> -U https://github.com/<username>/<repo>.git <file_name>.yml 
于 2018-08-22T20:44:14.343 回答
-1

在以下 repo 中浏览“README.md”和“pull.play”文件。
git 克隆https://github.com/harshad007/ansible_pull.git

对主机文件中的 git 存储库urlIP地址进行必要的更改

如果一切正常,首先将 pull.play 脚本作为“ansible-playbook pull.play”运行,然后在几分钟后检查“远程系统”上的 /var/log/ansible-pull.log。在这里,来自 GitHub 存储库的 local.yml 文件已执行。

于 2016-05-10T10:20:56.213 回答