我试图在远程主机上本地使用ansible pull,其中ansible在git repo上检索带有库存的剧本。
我不知道如何指向库存和组变量中的远程主机。我已尝试使用machine_name(user@machine_name在bash(,但它告诉我
[WARNING]: Could not match supplied host pattern, ignoring:
这是我的库存:
all:
children:
webserver:
hosts:
ip-172-31-21-218: #this is the machine name
dbserver:
hosts:
node2:
ansible_host: 34.201.53.127
我希望剧本使用主机在本地播放剧本,并使用ansible pull,但使用inventory来理解inventory机器名称与主机名称匹配。。。
这是官方文档中的样本,请继续阅读评论:(
all:
hosts: # you ignore this line
mail.example.com: # and this line also
children:
webservers:
hosts:
foo.example.com:
bar.example.com:
dbservers:
hosts:
one.example.com:
two.example.com:
three.example.com:
谨致问候。