vmware - Managing several portgroups on a cluster

50 views
Skip to first unread message

Drew Merryman

unread,
Jul 10, 2017, 11:46:55 AM7/10/17
to Ansible Project
Hey all, 
I'm new to Ansible but I'm really liking it so far. However, I think what I'm trying to do is a bit more advanced, or perhaps Ansible isn't the right tool? Here is the problem:

Currently I have several datacenters with a varying amount of clusters on each. On the clusters are some ESXi hosts with some vSwitches. These vSwitches are configured with Vlans and other things. I would like to manage these with Ansible. The goal would ideally be to (within a single cluster) make sure all the vSwitches on each host are running the same config. I.e. vSwitch1 on someServer01 has the same configuration as vSwitch1 on someServer02 within someCluster. Currently some of the portgroups get messed up between hosts, usually some vSwitches will be missing a Vlan, or maybe have the right number of Vlans but use the wrong number scheme. I would like to designate one portgroup as the "right one" and merely copy this config to the other vSwitches. 

I have read the documentation under http://docs.ansible.com/ansible/list_of_cloud_modules.html#vmware and looked at the vmware_portgroup and the vmware_dvs_portgroup modules, however these seem to only deal with explicitly creating/removing portgroups. Is there a way I could see the configuration of a portgroup, or even look at an existing vSwitch? 

If someone could point me in the right direction, that would be awesome. Thanks!

Kai Stian Olstad

unread,
Jul 11, 2017, 10:09:35 AM7/11/17
to ansible...@googlegroups.com
On 07. juli 2017 17:10, Drew Merryman wrote:
> I have read the documentation
> under http://docs.ansible.com/ansible/list_of_cloud_modules.html#vmware and
> looked at the vmware_portgroup and the vmware_dvs_portgroup modules,
> however these seem to only deal with explicitly creating/removing
> portgroups. Is there a way I could see the configuration of a portgroup, or
> even look at an existing vSwitch?

Ansible is a configuration management tool not a reporting tool, so see
configuration is out of Ansibles scope.

In Ansible you say how you would like your vswitches and portgroups to
be and Ansible make the necessary changes.

To see the configuraton, use Vcenter, embeded client, esxcli or some
other tool.

(with Ansible raw module and esxcli command you can get this information
out of the esx)

--
Kai Stian Olstad
Reply all
Reply to author
Forward
0 new messages