我对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。
发布于 2022-11-16 18:31:11
我也有过类似的问题:
[WARNING]: * Failed to parse pve.yml with auto plugin: inventory source 'pve.yml' could not be verified by inventory plugin 'community.general.proxmox'
[WARNING]: * Failed to parse pve.yml with yaml plugin: Plugin configuration YAML file, not YAML inventory
[WARNING]: * Failed to parse pve.yml with ini plugin: Invalid host pattern 'plugin:' supplied, ending in ':' is not allowed, this character is reserved to provide a port.
[WARNING]: Unable to parse pve.yml as an inventory source
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'
[WARNING]: Could not match supplied host pattern, ignoring: pve事实证明,这个问题很愚蠢,而且出乎意料。我进入了模块本身的代码,发现如下:
self.display.vvv('Skipping due to inventory source not ending in "proxmox.yaml" nor "proxmox.yml"')在我的例子中,带有结束*.proxmox.yml的所有选项都不起作用(例如,my.proxmox.yml)。所以我把我的库存文件重命名为proxmox.yml,它起作用了。我的存货:
plugin: community.general.proxmox
url: https://my.pve.host:8006
user: ansible-prov@pve
token_id: ansible
token_secret: <token>
validate_certs: false
want_proxmox_nodes_ansible_host: false
compose:
ansible_host: proxmox_ipconfig0.ip | default(proxmox_net0.ip) | ipaddr('address')https://stackoverflow.com/questions/74431714
复制相似问题