Create multiple vmware_ tags

Hello everyone,

I would like to show you a case I don’t understand.
I want create multiple vmware tags on vSphere with vmware_tag module. Tag list is based on my Inventory

I have 2 use case:

  • First case working:
---
- name: Gather Facts
  hosts: localhost
  gather_facts: no

  tasks:
  - name: Create tags to APP
    vmware_tag:
      hostname: 'vsrv-vc-app'
      username: '***'
      password: '***'
      validate_certs: false
      category_id: 'urn:vmomi:InventoryServiceCategory:2c4b269b-6414-47b5-848b-c5812ddf6d24:GLOBAL'
      tag_name: '{{ item }}'
      tag_description: '** {{ item }} via ANSIBLE - TEST'
      state: present
    delegate_to: localhost
    with_items:
      - test1 IB
      - test2 IB
      - test3 IB
      - test4 IB
  • Second one (don’t work), And I don’t understand why:

Inventory

[veeam]
serverA tag_save="test1 IB"
serverB tag_save="test2 IB"
serverC tag_save="test3 IB"
serverD tag_save="test4 IB"

Playbook

---
- name: Gather Facts
  hosts: veeam
  gather_facts: no

  tasks:
  - name: Create tags to APP
    vmware_tag:
      hostname: 'vsrv-vc-app'
      username: '****'
      password: '****'
      validate_certs: false
      category_id: 'urn:vmomi:InventoryServiceCategory:2c4b269b-6414-47b5-848b-c5812ddf6d24:GLOBAL'
      tag_name: '{{ tag_save }}'
      tag_description: '** {{ tag_save }} via ANSIBLE - TEST'
      state: present
    delegate_to: localhost

Anyone could test this 2 case with your vmware server ? I need to know If it’s a real bug, a Wrong syntax or something else ? :slight_smile:
Thanks a lot