Sorry for the delay,
The problem with your solution is that I have too much information and I
would like to have only the machines of a TAG.
I tried this:
[image: image.png]
But it doesn't work my inventory is empty.

Regards,
Soufiane

Le mer. 21 juil. 2021 à 12:05, Abhijeet Kasurde <akasu...@redhat.com> a
écrit :

> Oh sorry, I missed the previous email.
>
> You already have that configuration which enables groups of tags with
> `with_tags: True`
>
> plugin: community.vmware.vmware_vm_inventory
> hostnames:
> - 'config.name'
> properties:
> - 'config.name'
> - 'config.guestId'
> - 'guest.ipAddress'
> - 'summary.runtime.powerState'
> with_tags: True
> with_nested_properties: True
>
> With this configuration, I get groups like -
>
> {
>     "OTHER": {
>         "hosts": [
>             "c_422e86b3-0e53-7c0d-1b9c-5d653f91ab3d"
>         ]
>     },
>     "PROD": {
>         "hosts": [
>             "b_422e4de4-1d3c-a793-0693-e1ee79978bd3"
>         ]
>     },
>     "TEST": {
>         "hosts": [
>             "a_422e78e3-2837-9c59-5471-11992032d1f1"
>         ]
>     },
>     "_meta": {
>         "hostvars": {
>             "CentOS7_Rest_2_4207e1ea-e0be-f313-0c2a-31979450e76c": {
>                 "config.guestId": "otherLinux64Guest",
>                 "config.name": "CentOS7_Rest_2",
>
> On Wed, Jul 21, 2021 at 3:01 PM Sofian El-Kadouri <
> sofian.elkado...@gmail.com> wrote:
>
>> Hello Abhijeet Kasurde,
>> Sorry I didn't get an answer...
>> I hope that nothing serious happened to you
>> Regards,
>> Soufiane
>>
>> Le lun. 5 juil. 2021 à 15:56, Abhijeet Kasurde <akasu...@redhat.com> a
>> écrit :
>>
>>> Yes,
>>>
>>> Could you please paste your current inventory configuration file and
>>> requirement so that I can give you an example?
>>>
>>> Thanks,
>>>
>>> On Mon, Jul 5, 2021 at 7:19 PM Sofian El-Kadouri <
>>> sofian.elkado...@gmail.com> wrote:
>>>
>>>> Hello Abhijeet Kasurde,
>>>> Sorry for the delay, I succeeded in changing the rights.
>>>> I now have an inventory with hundreds of lines and info,
>>>> is it possible to have a simple inventory sorted by TAG ? ( on my
>>>> vcenter my machines are tagged by PROD or TEST)
>>>> Thank you very much for your help!
>>>> Sincerely,
>>>> Soufiane
>>>>
>>>> Le lun. 21 juin 2021 à 14:37, Abhijeet Kasurde <akasu...@redhat.com> a
>>>> écrit :
>>>>
>>>>> Hi Sofian,
>>>>>
>>>>> Please see this error/warning message -
>>>>>
>>>>> Skipping due to inventory source not existing or not being readable by
>>>>> the current user
>>>>> ansible_collections.community.vmware.plugins.inventory.vmware_vm_inventory
>>>>> declined parsing /home/admincpc/inventory.vmware.yml as it did not pass 
>>>>> its
>>>>> verify_file() method
>>>>>
>>>>> Check if /home/admincpc/inventory.vmware.yml is accessible and
>>>>> readable by the current user (the user which is running the
>>>>> ansible-inventory command).
>>>>>
>>>>> On Mon, Jun 21, 2021 at 5:59 PM Sofian El-Kadouri <
>>>>> sofian.elkado...@gmail.com> wrote:
>>>>>
>>>>>> Hi Abhijeet,
>>>>>> Thank you very much for your help and your speed !
>>>>>> I install the version Ansible 2.12 and there is no error message :)
>>>>>> But my inventory does not return anything, Do you have an idea ?
>>>>>> Sorry I'm a beginner on Ansible
>>>>>>
>>>>>> Thanks for your help :)
>>>>>>
>>>>>> [DEPRECATION WARNING]: Ansible will require Python 3.8 or newer on
>>>>>> the controller starting with Ansible 2.12.
>>>>>> Current version: 2.7.17 (default, Feb 27 2021, 15:10:58) [GCC 7.5.0].
>>>>>> This feature will be removed from ansible-
>>>>>> core in version 2.12. Deprecation warnings can be disabled by setting
>>>>>> deprecation_warnings=False in ansible.cfg.
>>>>>> /usr/local/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 the next release.
>>>>>>   from cryptography.exceptions import InvalidSignature
>>>>>> ansible-inventory [core 2.11.1]
>>>>>>   config file = /etc/ansible/ansible.cfg
>>>>>>   configured module search path =
>>>>>> [u'/home/admincpc/.ansible/plugins/modules',
>>>>>> u'/usr/share/ansible/plugins/modules']
>>>>>>   ansible python module location =
>>>>>> /usr/local/lib/python2.7/dist-packages/ansible
>>>>>>   ansible collection location =
>>>>>> /home/admincpc/.ansible/collections:/usr/share/ansible/collections
>>>>>>   executable location = /usr/local/bin/ansible-inventory
>>>>>>   python version = 2.7.17 (default, Feb 27 2021, 15:10:58) [GCC 7.5.0]
>>>>>>   jinja version = 2.10
>>>>>>   libyaml = True
>>>>>> Using /etc/ansible/ansible.cfg as config file
>>>>>> redirecting (type: inventory) ansible.builtin.vmware_vm_inventory to
>>>>>> community.vmware.vmware_vm_inventory
>>>>>> Skipping due to inventory source not existing or not being readable
>>>>>> by the current user
>>>>>> ansible_collections.community.vmware.plugins.inventory.vmware_vm_inventory
>>>>>> declined parsing /home/admincpc/inventory.vmware.yml as it did not pass 
>>>>>> its
>>>>>> verify_file() method
>>>>>> [WARNING]: Unable to parse /home/admincpc/inventory.vmware.yml as an
>>>>>> inventory source
>>>>>> [WARNING]: No inventory was parsed, only implicit localhost is
>>>>>> available
>>>>>> {
>>>>>>     "_meta": {
>>>>>>         "hostvars": {}
>>>>>>     },
>>>>>>     "all": {
>>>>>>         "children": [
>>>>>>             "ungrouped"
>>>>>>         ]
>>>>>>     }
>>>>>> }
>>>>>>
>>>>>> Le lun. 21 juin 2021 à 09:55, Abhijeet Kasurde <akasu...@redhat.com>
>>>>>> a écrit :
>>>>>>
>>>>>>> Hi Sofian,
>>>>>>>
>>>>>>> You are using Ansible 2.5.1 and Python 2.7.17. Both are End-of-life
>>>>>>> and not supported.
>>>>>>>
>>>>>>> Could you please retry with the latest Ansible and latest Python?
>>>>>>> Thanks
>>>>>>>
>>>>>>> On Mon, Jun 21, 2021 at 1:21 PM Sofian El-Kadouri <
>>>>>>> sofian.elkado...@gmail.com> wrote:
>>>>>>>
>>>>>>>> Hello Abhijeet Kasure,
>>>>>>>> Thanks for your answer !
>>>>>>>> My inventory configuration file *inventory.vmware.yml* is :
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> *plugin: vmware_vm_inventorystrict: Falsehostname:
>>>>>>>> 10.0.1.1username: sa.elkado...@coppernic.fr
>>>>>>>> <sa.elkado...@coppernic.fr>password: Mypasswordvalidate_certs:
>>>>>>>> Falsewith_tags: True*
>>>>>>>>
>>>>>>>> And with -vvv :
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> */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 the next release.  from cryptography.exceptions 
>>>>>>>> import
>>>>>>>> InvalidSignatureansible-inventory 2.5.1  config file =
>>>>>>>> /etc/ansible/ansible.cfg  configured module search path =
>>>>>>>> [u'/home/admincpc/.ansible/plugins/modules',
>>>>>>>> u'/usr/share/ansible/plugins/modules']  ansible python module location 
>>>>>>>> =
>>>>>>>> /usr/lib/python2.7/dist-packages/ansible  executable location =
>>>>>>>> /usr/bin/ansible-inventory  python version = 2.7.17 (default, Feb 27 
>>>>>>>> 2021,
>>>>>>>> 15:10:58) [GCC 7.5.0]Using /etc/ansible/ansible.cfg as config
>>>>>>>> file [WARNING]: Failed to load inventory plugin, skipping
>>>>>>>> vmware_vm_inventoryERROR! No inventory plugins available to generate
>>>>>>>> inventory, make sure you have at least one whitelisted.*
>>>>>>>>
>>>>>>>> Thanks for your help !
>>>>>>>>
>>>>>>>> Le ven. 18 juin 2021 à 15:39, Abhijeet Kasurde <akasu...@redhat.com>
>>>>>>>> a écrit :
>>>>>>>>
>>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>> Could you please share your Inventory configuration file? Also,
>>>>>>>>> -vvv console log?
>>>>>>>>>
>>>>>>>>> Thanks
>>>>>>>>>
>>>>>>>>> On Fri, Jun 18, 2021 at 6:53 PM Sofian El-Kadouri <
>>>>>>>>> sofian.elkado...@gmail.com> wrote:
>>>>>>>>>
>>>>>>>>>> Hello,
>>>>>>>>>> I want to set up a dynamic inventory but I have a problem with
>>>>>>>>>> the plugin. I have followed the ansible documentation :
>>>>>>>>>> https://docs.ansible.com/ansible/latest/scenario_guides/vmware_scenarios/vmware_inventory.html
>>>>>>>>>> I followed the tutorial but I get this error message:
>>>>>>>>>>
>>>>>>>>>>  [WARNING]: Failed to load inventory plugin, skipping
>>>>>>>>>> vmware_vm_inventory
>>>>>>>>>>
>>>>>>>>>> ERROR! No inventory plugins available to generate inventory, make
>>>>>>>>>> sure you have at least one whitelisted.
>>>>>>>>>>
>>>>>>>>>> Did you encounter this problem?
>>>>>>>>>>
>>>>>>>>>> Thanks in advance
>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>> 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-project+unsubscr...@googlegroups.com.
>>>>>>>>>> To view this discussion on the web visit
>>>>>>>>>> https://groups.google.com/d/msgid/ansible-project/ffb15565-f732-4cb6-b239-872767f0f2b2n%40googlegroups.com
>>>>>>>>>> <https://groups.google.com/d/msgid/ansible-project/ffb15565-f732-4cb6-b239-872767f0f2b2n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>>>>>> .
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> Thanks,
>>>>>>>>> Abhijeet Kasurde
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> You received this message because you are subscribed to a topic in
>>>>>>>>> the Google Groups "Ansible Project" group.
>>>>>>>>> To unsubscribe from this topic, visit
>>>>>>>>> https://groups.google.com/d/topic/ansible-project/a6JDjsDWgjI/unsubscribe
>>>>>>>>> .
>>>>>>>>> To unsubscribe from this group and all its topics, send an email
>>>>>>>>> to ansible-project+unsubscr...@googlegroups.com.
>>>>>>>>> To view this discussion on the web visit
>>>>>>>>> https://groups.google.com/d/msgid/ansible-project/CAFwWkHqo_n2E%2BADoNohYBagbEdP06zByQc%3DB6zEG%3DqpgLE7DPQ%40mail.gmail.com
>>>>>>>>> <https://groups.google.com/d/msgid/ansible-project/CAFwWkHqo_n2E%2BADoNohYBagbEdP06zByQc%3DB6zEG%3DqpgLE7DPQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>>>>>> .
>>>>>>>>>
>>>>>>>> --
>>>>>>>> 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-project+unsubscr...@googlegroups.com.
>>>>>>>> To view this discussion on the web visit
>>>>>>>> https://groups.google.com/d/msgid/ansible-project/CABMz63y7d7_49p5UaDJuuH6fpBosrWc-okqRZzPzJ3-iTwmVZg%40mail.gmail.com
>>>>>>>> <https://groups.google.com/d/msgid/ansible-project/CABMz63y7d7_49p5UaDJuuH6fpBosrWc-okqRZzPzJ3-iTwmVZg%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>>>>> .
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Thanks,
>>>>>>> Abhijeet Kasurde
>>>>>>>
>>>>>>> --
>>>>>>> You received this message because you are subscribed to a topic in
>>>>>>> the Google Groups "Ansible Project" group.
>>>>>>> To unsubscribe from this topic, visit
>>>>>>> https://groups.google.com/d/topic/ansible-project/a6JDjsDWgjI/unsubscribe
>>>>>>> .
>>>>>>> To unsubscribe from this group and all its topics, send an email to
>>>>>>> ansible-project+unsubscr...@googlegroups.com.
>>>>>>> To view this discussion on the web visit
>>>>>>> https://groups.google.com/d/msgid/ansible-project/CAFwWkHqieuXiNr6U59YkU9HirKdVJ_-UCd%2B6%2BCR5WQxdPj1C5w%40mail.gmail.com
>>>>>>> <https://groups.google.com/d/msgid/ansible-project/CAFwWkHqieuXiNr6U59YkU9HirKdVJ_-UCd%2B6%2BCR5WQxdPj1C5w%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>>>> .
>>>>>>>
>>>>>> --
>>>>>> 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-project+unsubscr...@googlegroups.com.
>>>>>> To view this discussion on the web visit
>>>>>> https://groups.google.com/d/msgid/ansible-project/CABMz63zZX_3tYO_BCOYOf6O_YwejfrELB9wrFe7N4seyW7V4iA%40mail.gmail.com
>>>>>> <https://groups.google.com/d/msgid/ansible-project/CABMz63zZX_3tYO_BCOYOf6O_YwejfrELB9wrFe7N4seyW7V4iA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>>> .
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Thanks,
>>>>> Abhijeet Kasurde
>>>>>
>>>>> --
>>>>> You received this message because you are subscribed to a topic in the
>>>>> Google Groups "Ansible Project" group.
>>>>> To unsubscribe from this topic, visit
>>>>> https://groups.google.com/d/topic/ansible-project/a6JDjsDWgjI/unsubscribe
>>>>> .
>>>>> To unsubscribe from this group and all its topics, send an email to
>>>>> ansible-project+unsubscr...@googlegroups.com.
>>>>> To view this discussion on the web visit
>>>>> https://groups.google.com/d/msgid/ansible-project/CAFwWkHrSjeL%3D1tS4zgXg%2BqSWpfuxo4%2BXCsVLQHjpDKW3iFpA_g%40mail.gmail.com
>>>>> <https://groups.google.com/d/msgid/ansible-project/CAFwWkHrSjeL%3D1tS4zgXg%2BqSWpfuxo4%2BXCsVLQHjpDKW3iFpA_g%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>>
>>>> --
>>>> 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-project+unsubscr...@googlegroups.com.
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/ansible-project/CABMz63xANup4Eo2jc-JFrk4bXRfnAmyRVvaq0D2OVCcuyLU7rw%40mail.gmail.com
>>>> <https://groups.google.com/d/msgid/ansible-project/CABMz63xANup4Eo2jc-JFrk4bXRfnAmyRVvaq0D2OVCcuyLU7rw%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>>
>>>
>>> --
>>> Thanks,
>>> Abhijeet Kasurde
>>>
>>> --
>>> You received this message because you are subscribed to a topic in the
>>> Google Groups "Ansible Project" group.
>>> To unsubscribe from this topic, visit
>>> https://groups.google.com/d/topic/ansible-project/a6JDjsDWgjI/unsubscribe
>>> .
>>> To unsubscribe from this group and all its topics, send an email to
>>> ansible-project+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/ansible-project/CAFwWkHqc2b-2TMtiB68sX3zpFGUo%3DOeaPz6J%2BaEtifUEJROJtg%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/ansible-project/CAFwWkHqc2b-2TMtiB68sX3zpFGUo%3DOeaPz6J%2BaEtifUEJROJtg%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
>> 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-project+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/ansible-project/CABMz63xHohtXTJty6pix%2BjjCnJOz9GSkN69yrUAQuuP4tFATEQ%40mail.gmail.com
>> <https://groups.google.com/d/msgid/ansible-project/CABMz63xHohtXTJty6pix%2BjjCnJOz9GSkN69yrUAQuuP4tFATEQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>
>
> --
> Thanks,
> Abhijeet Kasurde
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Ansible Project" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/ansible-project/a6JDjsDWgjI/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> ansible-project+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/CAFwWkHpzwxc05b_jACngiiWF7MYiwZVVKsmmpozoBw_JAcA_qg%40mail.gmail.com
> <https://groups.google.com/d/msgid/ansible-project/CAFwWkHpzwxc05b_jACngiiWF7MYiwZVVKsmmpozoBw_JAcA_qg%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CABMz63y_%2BH7VZzaG5FggSAOp0ZD-X2nArj_1YQyxO%3D7XvdbV2A%40mail.gmail.com.

Reply via email to