Skip to content

community.vmware.vmware_category module needs update state #2520

@dwaynebullock

Description

@dwaynebullock
SUMMARY

When updating/editing an existing Category associable_object_types the current present state sees the Category already exists and just skips it.

ISSUE TYPE
  • Add Update option to state
COMPONENT NAME

community.vmware.vmware_category

ADDITIONAL INFORMATION

So lets say we have a Category called Lab that has the associable_object_types set to VM. Now we want to be able to add hosts to that same Category. The current states of "present and absent" will not update the Category and just goes on because the Category already exists.

Create Lab Category with type of VM
  - name: Create Lab category VM
    community.vmware.vmware_category:
      hostname: '{{ lookup("env", "VMWARE_HOST") }}'
      username: '{{ lookup("env", "VMWARE_USER") }}'
      password: '{{ lookup("env", "VMWARE_PASSWORD") }}'
      validate_certs: false   
      category_name: 'Lab'
      category_description: ''
      associable_object_types: "Virtual Machine"
      state: present

Update Lab Category to add type Host to the already existing Lab Category. This just see it exists and does nothing..

  - name: Update Lab category to include hosts now
    community.vmware.vmware_category:
      hostname: '{{ lookup("env", "VMWARE_HOST") }}'
      username: '{{ lookup("env", "VMWARE_USER") }}'
      password: '{{ lookup("env", "VMWARE_PASSWORD") }}'
      validate_certs: false   
      category_name: 'Lab'
      category_description: ''
      associable_object_types: "Host"
      state: present

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions