【问题标题】:When I try to ping my VM's using ansible, it tries to ping the server id instead of IP当我尝试使用 ansible ping 我的 VM 时,它会尝试 ping 服务器 ID 而不是 IP
【发布时间】:2018-11-20 04:54:38
【问题描述】:

我使用 OpenStack heat 创建了一个 VM,在创建 VM 之后,我尝试使用 Ansible 提供的动态库存 openstack_inventory.py 使用 ansible ping VM。 但是当我使用 ping 模块时,它会尝试连接虚拟机的 id 而不是 IP。

【问题讨论】:

    标签: dynamic ansible openstack inventory heat


    【解决方案1】:

    openstack.yaml 中变量“use_hostnames”的值是多少? 尝试切换变量值。

    use_hostnames 改变了注册每个主机的行为 它的 UUID 和一组它的主机名只 如果有问题的主机名超过 一台服务器

    参考:https://github.com/ansible/ansible/blob/devel/contrib/inventory/openstack_inventory.py

    【讨论】:

    • use_hostnames = inventory.extra_config['use_hostnames']
    • 而 Anant 我也更改了以下行。它是 ansible_host=server['interface_ip'] 我将其更改为 ansible_host=server['private_v4']
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-21
    • 1970-01-01
    • 2019-08-10
    • 1970-01-01
    • 2018-08-07
    相关资源
    最近更新 更多