community.vmware icon indicating copy to clipboard operation
community.vmware copied to clipboard

with_path cannot be yes

Open usscarter opened this issue 4 years ago • 10 comments

SUMMARY

When attempting to set with_path: yes, you get the following error:

[WARNING]: * Failed to parse /home/user/ansiblevmware/inventories/production/filename.vmware.yml with ansible_collections.community.vmware.plugins.inventory.vmware_vm_inventory plugin: Invalid empty/false group name provided:

ISSUE TYPE
  • Bug Report
COMPONENT NAME

vmware_vm_inventory.py

ANSIBLE VERSION
/usr/lib/python2.7/dist-packages/ansible/parsing/vault/__init__.py:44: CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in a future release.
  from cryptography.exceptions import InvalidSignature
ansible 2.9.14
  config file = /home/User/ansiblevmware/ansible.cfg
  configured module search path = [u'/home/User/ansiblevmware/library']
  ansible python module location = /usr/lib/python2.7/dist-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.17 (default, Jul 20 2020, 15:37:01) [GCC 7.5.0]

CONFIGURATION
/usr/lib/python2.7/dist-packages/ansible/parsing/vault/__init__.py:44: CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in a future release.
  from cryptography.exceptions import InvalidSignature
CACHE_PLUGIN_CONNECTION(/home/user/ansiblevmware/ansible.cfg) = ~/.cache/
DEFAULT_CALLBACK_WHITELIST(/home/user/ansiblevmware/ansible.cfg) = [u'profile_tasks', u'timer']
DEFAULT_FILTER_PLUGIN_PATH(/home/User/ansiblevmware/ansible.cfg) = [u'/home/User/ansiblevmware/filter_plugins']
DEFAULT_HOST_LIST(/home/User/ansiblevmware/ansible.cfg) = [u'/home/User/ansiblevmware/inventories/production']
DEFAULT_MODULE_PATH(/home/User/ansiblevmware/ansible.cfg) = [u'/home/User/ansiblevmware/library']
DEFAULT_MODULE_UTILS_PATH(/home/User/ansiblevmware/ansible.cfg) = [u'/home/User/ansiblevmware/module_utils']
DEFAULT_ROLES_PATH(/home/User/ansiblevmware/ansible.cfg) = [u'/home/User/.ansible/roles', u'/usr/share/ansible/roles', u'/etc/ansible/roles', u'/home/User/ansiblevmware/roles']
DEFAULT_STDOUT_CALLBACK(/home/User/ansiblevmware/ansible.cfg) = yaml
DEFAULT_VAULT_PASSWORD_FILE(/home/User/ansiblevmware/ansible.cfg) = /opt/playbooks/.vaultpwd
HOST_KEY_CHECKING(/home/User/ansiblevmware/ansible.cfg) = False
INTERPRETER_PYTHON(/home/User/ansiblevmware/ansible.cfg) = auto
INVENTORY_ENABLED(/home/User/ansiblevmware/ansible.cfg) = [u'community.vmware.vmware_vm_inventory']
SYSTEM_WARNINGS(/home/User/ansiblevmware/ansible.cfg) = False

OS / ENVIRONMENT

Ubuntu 18.04.5 LTS

STEPS TO REPRODUCE
plugin: community.vmware.vmware_vm_inventory
strict: False
hostname: 
username: 
password:
validate_certs: False
with_tags: yes
with_path: yes
hostnames:
- config.name
groups:
  kwd: True
properties:
    - 'name'
    - 'config.instanceUuid'
    - 'config.hardware.numCPU'
    - 'config.template'
    - 'config.name'
    - 'config.uuid'
    - 'guest.hostName'
    - 'guest.ipAddress'
    - 'guest.guestId'
    - 'guest.guestState'
    - 'summary.runtime.powerState'
    - 'config.guestId'
    - 'guest.toolsVersionStatus'
compose:
  ansible_host: guest.ipAddress
  folder: path.split('/')[-1].lower()
  subnet: (guest.ipAddress + '/24') | ipv4('network')
keyed_groups:
  - key: folder
    prefix: kwd
filters:
- runtime.powerState == "poweredOn"
- '"Z-VRA" not in config.name'

EXPECTED RESULTS

Expect an inventory return

ACTUAL RESULTS

[WARNING]: * Failed to parse /home/User/ansiblevmware/inventories/production/file.vmware.yml with ansible_collections.community.vmware.plugins.inventory.vmware_vm_inventory plugin: Invalid empty/false group name provided:

ansible-inventory --graph

usscarter avatar Oct 07 '20 21:10 usscarter