VMware {code} Community
purplexedv
Contributor
Contributor

Fetching the IP Address of a new VM created from template.

Is it possible to get the IP address of a VM created from template using the vsphere sdk? I intend to use perl for this. Some pointers would be helpful. The idea is to run ansible playbooks inside the VM once launched.

Thanks!

Reply
0 Kudos
1 Reply
gcanales
Enthusiast
Enthusiast

Hi,

I've made an Ansible playbook to launch a VM from a template, script talks to pysphere through the Ansible modules. It gathers the IP address and perform some OS customization using Ansible, even sends an Slack notification at the end. Comments are in spanish though, but I think you could use some from it.

https://gist.github.com/gcanales75/b965ed300c224064e92f

If you have questions please let me know, would be happy to help.

Reply
0 Kudos