【发布时间】:2020-12-16 21:07:06
【问题描述】:
我在 yaml 格式的 ansible hosts 文件中使用 localhost。每当我运行剧本时,我都会收到以下警告。 playbook 使用隐式 localhost 成功运行。为什么会发生这种情况,我该如何纠正?
➜ ec2 ansible-playbook site.yml -i inventory/hosts.yml
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'
我不清楚 ansible 为什么会报告此警告。以下是我的 hosts.yml 内容。
all:
children:
hosts:
localhost:
【问题讨论】: