【发布时间】:2022-11-17 03:02:12
【问题描述】:
我想由 Proxmox 生成的动态清单有问题。我创建了一个 inventory.proxmox.yml 文件。这包含以下配置:
plugin: community.general.proxmox
url: https://MyIP:8006
user: ansible@pve
password: my_password
validate_certs: false
want_proxmox_nodes_ansible_host: false
在下一步中,我想创建库存。为此,我进行如下操作:
ansible-inventory -i inventory.proxmox.yml --list
执行后,我收到以下错误:
/usr/lib/python3/dist-packages/urllib3/connectionpool.py:1015: InsecureRequestWarning: Unverified HTTPS request is being made to host 'myIP'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
warnings.warn(
[WARNING]: * Failed to parse /home/user/ansible/inventory/inventory.proxmox.yml with auto plugin: 'NoneType' object is not subscriptable
[WARNING]: * Failed to parse /home/user/ansible/inventory/inventory.proxmox.yml with yaml plugin: Plugin configuration YAML file, not YAML inventory
[WARNING]: * Failed to parse /home/user/ansible/inventory/inventory.proxmox.yml with ini plugin: Invalid host pattern 'plugin:' supplied, ending in ':' is not
allowed, this character is reserved to provide a port.
[WARNING]: * Failed to parse /home/user/ansible/inventory/inventory.proxmox.yml with ansible_collections.community.general.plugins.inventory.proxmox plugin:
'NoneType' object is not subscriptable
[WARNING]: Unable to parse /home/user/ansible/inventory/inventory.proxmox.yml as an inventory source
[WARNING]: No inventory was parsed, only implicit localhost is available
将我的 yml 文件中的“url: https”更改为“http”确实摆脱了 https 错误。但是,proxmox 没有在 http 上监听。
【问题讨论】:
-
我不明白。库存从哪里获得?来自 proxmox?还是您手动配置库存?
-
您好,我已经手动创建了库存。但是,目标是从 proxmox 读取所有现有的 VM,包括主机名/IP,并将它们用作清单。
-
为什么?您会经常构建/破坏虚拟机吗?为什么不在清单文件中配置一次呢?