gpt4 book ai didi

ansible - 具有 IP 范围的主机

转载 作者:行者123 更新时间:2023-12-05 01:46:46 25 4
gpt4 key购买 nike

我的主机没有稳定的主机名,但有预定义的 IP 范围。
如何为 Ansible list 文件设置 IP 范围?

我正在尝试设置这样的东西:

test.ini:

[database]
db ansible_ssh_host=1.1.1.[20:25] ansible_ssh_port=22
[lemp]
lemp ansible_ssh_host=1.1.1.[10:15] ansible_ssh_port=22

现在我在运行 ansible-playbook -i test.ini 后得到这个错误:

fatal: [db] => SSH Error: ssh: Could not resolve hostname 1.1.1.[20:25]: Name or service not known

最佳答案

我为我的问题找到了这个有效的解决方案:

test.ini:

# I removed hostname section and ansible_ssh_host=
10.0.3.[20:25] ansible_ssh_port=22

关于ansible - 具有 IP 范围的主机,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33648627/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com