我知道将Ansible转变为pull架构是可能的:https://docs.ansible.com/ansible/2.4/ansible-pull.html
我遇到的麻烦是,Ansible似乎仍然想要管理库存。所以使用脚本来拉取存储库:
ansible-pull -U <repository> [options] [<playbook.yml>]我收到以下警告:
[WARNING]: Could not match supplied host pattern, ignoring: XYZA在运行actual playbook时,我得到了这样的消息:
PLAY [all] ********************************************************************************************************
skipping: no hosts matched默认情况下,Ansible将在/etc/ansible/hosts文件中搜索主机。但现在它正在拉动,在我看来,它不应该关心主机。我知道我还可以将带有-i参数的主机指定为数组,例如:
ansible-pull -U git@github.com/somerepo -i localhost, playbook.yml但在我的例子中,有很多主机,我只想对从该存储库中提取的所有主机运行攻略。有没有办法做到这一点,或者我需要为每个主机动态指定单独的脚本/清单?
编辑:我也尝试过-i all或-i all,,但似乎对我不起作用。
发布于 2018-02-05 23:23:52
这似乎只是一个警告,而不是一个错误,所以Ansible pull仍然应该运行。使用inventory localhost运行它会起到作用:ansible-pull -U git@github.com/somerepo -i localhost, playbook.yml
https://stackoverflow.com/questions/48625497
复制相似问题