Deploy a vm using ansible playbook

In this article i’m going to shar the steps of deploy a vm using ansible playboook

I’m using two yaml files for this excersice.

in the vars.yml file I”m proving the vcenter environment details as a variables.

I have defined vcener fqdn,datacenter name, credential and vm template name.

Also I have disabled ssl verification sing vcenter_validate_certs: false parameter. The reason is we are using self sign ssl in our vcenter and its not trusted in the linux vm which i’m using to run this playbook.

in the second yml file(vm_deploy.yml).In this playbook i’m grabbing inputs from vars.yml. Other than that Ive added vmname , folder name , power state and wait for ip option here.

Now we can run this play book.

I have added these yml files to below github.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: