我试图使用ansible -拉本地在一个远程主机,其中ansible检索一个游戏手册在一个git回购与库存。
我不知道如何在库存和组vars中指向远程主机。我尝试过使用machine_name (user@machine_name in 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我希望剧本使用主机在本地播放剧本,但使用目录来理解库存机器名称与主机名匹配.
发布于 2022-09-09 00:46:00
这是官方文档中的示例,请继续阅读评论:)
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:致以问候。
https://stackoverflow.com/questions/73651238
复制相似问题