Automation

 View Only

Ansible AWX inventory based on vmware cluster

  • 1.  Ansible AWX inventory based on vmware cluster

    Posted Feb 10, 2022 12:26 PM

    I have an inventory based on guest OS from VMWare, but i also want to separate by cluster. But i cant see that guest is cluster aware, and has no properties with cluster name.

    My goal is to use ansible to make affinity rule with all windows servers in a cluster, and run this on a schedule via AWX.

    I have not found a way to this yet.

    This gives me all VMs with Windows OS in vcenter.

    ---
    validate_certs: false
    properties:
    - guest.guestState
    - guest.guestFamily
    - guest.guestFullName
    - guest.net
    - config.name
    filters:
    - guest.guestFamily == "windowsGuest"

    I was trying to use guest.net as a properties, as the result in "network" has the cluster name as a part of the name. Using some kind of wildcard. But there may be a much quicker way to the goal here?