---
title: VMware Tag Info
slug: homologacao-atmosphere/vmware-tag-info
description: Learn how to collect information about VMware tags with this module summary. Discover its compatibility with vSphere 6 and above, API write access requirement, and exclusion from free ESXi licenses. Explore practical examples and find out the key values r
createdAt: 2023-03-16T18:03:59.000Z
---

Resumo



- Este módulo pode ser usado para coletar informações sobre tags VMware.
- O recurso de tag foi introduzido na versão vSphere 6, portanto, este módulo não é compatível com as versões anteriores do vSphere.
- Todas as variáveis ​​e nomes de objetos VMware diferenciam maiúsculas de minúsculas.



## Parâmetros

Estende fragmentos da documentação do módulo [VMware Options](https://app.archbee.com/docs/qhqZWWA92JYWAihQOL_T5/lUq5eineIhH7ZwvyWZYCa).

## Notas

Observação

- Testado em ESXi 7.0.2
- Todos os módulos requerem acesso de gravação API e, portanto, não são suportados em uma licença ESXi gratuita.

## Exemplos

```yaml
- name: Get info about tag
  community.vmware.vmware_tag_info:
    hostname: '{{ vcenter_hostname }}'
    username: '{{ vcenter_username }}'
    password: '{{ vcenter_password }}'
  delegate_to: localhost

- name: Get category id from the given tag
  community.vmware.vmware_tag_info:
    hostname: '{{ vcenter_hostname }}'
    username: '{{ vcenter_username }}'
    password: '{{ vcenter_password }}'
  delegate_to: localhost
  register: tag_details
- debug:
    msg: "{{ tag_details.tag_facts['fedora_machines']['tag_category_id'] }}"

- name: Gather tag id from the given tag
  community.vmware.vmware_tag_info:
    hostname: "{{ vcenter_hostname }}"
    username: "{{ vcenter_username }}"
    password: "{{ vcenter_password }}"
  delegate_to: localhost
  register: tag_results
- set_fact:
    tag_id: "{{ item.tag_id }}"
  loop: "{{ tag_results.tag_info|json_query(query) }}"
  vars:
    query: "[?tag_name==`tag0001`]"
- debug: var=tag_id

```

## Valores Retornados

| **Chave**  | **Tipo** | **Retornado quando** | **Descrição**                         |
| ---------- | -------- | -------------------- | ------------------------------------- |
| tag\_facts | dict     | sucesso              | dicionário de metadados de tags<br /> |
| tag\_info  | list     | sucesso              | lista de metadados de tags            |

