Failed to load inventory plugin, skipping community.vmware.vmware_vm_inventory

Hi,

When i run below as Jenkins user i get error

ansible-playbook /etc/ansible/playbooks/uptime-inv-based.yml -i /etc/ansible/playbooks/dc-inv-ALL-vmware.yml
[WARNING]: Failed to load inventory plugin, skipping community.vmware.vmware_vm_inventory
ERROR! No inventory plugins available to generate inventory, make sure you have at least one whitelisted.

but when run as root it works

I tried PATH matching but no luck

Any suggestions Please ?

i removed dynamic inv & i can run playbook as jenkins user just fine

not sure what the dynamic inv plugin does not like to work with non-root user …

Any suggestions Please

Hi,

Can you check the permission of the /etc/ansible/playbooks/dc-inv-ALL-vmware.yml? if those are only root readable then the non-root users won’t be able to read it and you will get errors.

i already tried 777 on that file … no luck

Ddi you check the directories in that path as well?

yes dir are ok as well… see same playbook as soon as i remove the [inventory] section , with user jenkins works well… so something odd here or something really silly

checking below

grep -i plugin /etc/ansible/ansible.cfg
#plugin_filters_cfg = /etc/ansible/plugin_filters.yml

Ansible ships with some plugins that require whitelisting,

Custom plugins should not need this unless plugin author specifies it.

enable callback plugins, they can output to stdout but cannot be ‘stdout’ type.

set plugin path directories here, separate with colons

#action_plugins = /usr/share/ansible/plugins/action
#become_plugins = /usr/share/ansible/plugins/become
#cache_plugins = /usr/share/ansible/plugins/cache
#callback_plugins = /usr/share/ansible/plugins/callback
#connection_plugins = /usr/share/ansible/plugins/connection
#lookup_plugins = /usr/share/ansible/plugins/lookup
inventory_plugins = /usr/share/ansible/plugins/inventory
#vars_plugins = /usr/share/ansible/plugins/vars
#filter_plugins = /usr/share/ansible/plugins/filter
#test_plugins = /usr/share/ansible/plugins/test
#terminal_plugins = /usr/share/ansible/plugins/terminal
#strategy_plugins = /usr/share/ansible/plugins/strategy
#This option tells Ansible where to cache facts. The value is plugin dependent.
#For the jsonfile plugin, it should be a path to a local directory.
#For the redis plugin, the value is a host:port:database triplet: fact_caching_connection = localhost:6379:0

enable inventory plugins, default: ‘host_list’, ‘script’, ‘auto’, ‘yaml’, ‘ini’, ‘toml’

#enable_plugins = host_list, virtualbox, yaml, constructed

uncomment this line to cause the paramiko connection plugin to not record new host

enable_plugins = community.vmware.vmware_vm_inventory

found a possible issue , vmware modules got installed in root home …

/root/.ansible/collections/ansible_collections/community/vmware/plugins/modules
/root/.ansible/collections/ansible_collections/community/vmware/tests/unit/modules

SO copied & did 744 in below

/usr/share/ansible/plugins/modules.

but no luck so far

trying to undersand now to which config parameter installed in home dir & try re-install to generic location …

https://stackoverflow.com/questions/53750049/location-to-keep-ansible-custom-modules

found a possible issue , vmware modules got installed in root home ...

/root/.ansible/collections/ansible_collections/community/vmware/plugins/modules
/root/.ansible/collections/ansible_collections/community/vmware/tests/unit/modules

Why did you install that there?

SO copied & did 744 in below

/usr/share/ansible/plugins/modules.

What does "doing 744" mean?
If that is meant to be set as permission, then I wonder what you are
trying to do as that is not common for a directories nor for files.

And the point of this link is...?

I appreciate your ongoing journey of discovering the world of system
administration.
But instead of frantically trying random things from the internet and
posting the results here, perhaps it's better to ask some senior
colleague for help sorting out the basics first.
BTW your communication style with short message and little context
might be better for the "IRC" medium:
https://docs.ansible.com/ansible/latest/community/communication.html#irc-channels