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

1,324 views
Skip to first unread message

esxi...@gmail.com

unread,
Feb 12, 2021, 7:52:08 PM2/12/21
to Ansible Project

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 ?

#######################################

OS :

No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.2 LTS
Release:        20.04
Codename:       focal


#######################################

ansible 2.9.6
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/var/lib/jenkins/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  executable location = /usr/bin/ansible
  python version = 3.8.5 (default, Jul 28 2020, 12:59:40) [GCC 9.3.0]

#######################################

esxi...@gmail.com

unread,
Feb 12, 2021, 9:23:30 PM2/12/21
to Ansible Project
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

Abhijeet Kasurde

unread,
Feb 12, 2021, 10:38:33 PM2/12/21
to ansible...@googlegroups.com
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.

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/1a50cd54-baa9-44af-93b3-69fc9c48efb4n%40googlegroups.com.


--
Thanks,
Abhijeet Kasurde

esxi...@gmail.com

unread,
Feb 13, 2021, 2:05:06 AM2/13/21
to Ansible Project
i already tried 777 on that file ... no luck

Dick Visser

unread,
Feb 13, 2021, 4:42:43 AM2/13/21
to ansible...@googlegroups.com
Ddi you check the directories in that path as well?
> To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/cf7da6e2-ec2d-45f6-b1b3-35bc8bfb66c1n%40googlegroups.com.



--
Dick Visser
Trust & Identity Service Operations Manager
GÉANT

esxi...@gmail.com

unread,
Feb 13, 2021, 1:44:36 PM2/13/21
to Ansible Project
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

esxi...@gmail.com

unread,
Feb 13, 2021, 2:19:35 PM2/13/21
to Ansible Project

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

esxi...@gmail.com

unread,
Feb 14, 2021, 1:42:59 PM2/14/21
to Ansible Project
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 ..

esxi...@gmail.com

unread,
Feb 14, 2021, 1:50:08 PM2/14/21
to Ansible Project

Dick Visser

unread,
Feb 14, 2021, 3:41:30 PM2/14/21
to ansible...@googlegroups.com
On Sun, 14 Feb 2021 at 19:43, esxi...@gmail.com <esxi...@gmail.com> wrote:
>
> 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.

Dick Visser

unread,
Feb 14, 2021, 3:51:58 PM2/14/21
to ansible...@googlegroups.com
On Sun, 14 Feb 2021 at 19:50, esxi...@gmail.com <esxi...@gmail.com> wrote:
>
> https://stackoverflow.com/questions/53750049/location-to-keep-ansible-custom-modules

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
Reply all
Reply to author
Forward
0 new messages