# Ansible playbook to deploy a VM in a PXEBOOT envrionment

**URL:** <https://forum.ansible.com/t/ansible-playbook-to-deploy-a-vm-in-a-pxeboot-envrionment/20554>\
**Category:** Ansible Project\
**Tags:** ubuntu\
**Created:** [February 12, 2016, 12:19am UTC](https://forum.ansible.com/t/ansible-playbook-to-deploy-a-vm-in-a-pxeboot-envrionment/20554 "2016-02-12T00:19:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stuart\_Cracraft](https://avatars.discourse-cdn.com/v4/letter/s/d6d6ee/32.png) [@Stuart\_Cracraft](https://forum.ansible.com/u/Stuart_Cracraft)\
**Post date:** [February 12, 2016, 12:19am UTC](https://forum.ansible.com/t/ansible-playbook-to-deploy-a-vm-in-a-pxeboot-envrionment/20554/1 "2016-02-12T00:19:13Z")

</div>

My present Ansible playbook can spin-up a VM in the interactive Ubuntu installation (e.g. waiting for you to select the language on the first screen), but I’ve not been able to get it instead to go to the PXEBOOT/KICKSTART server on the same network. The P/K works fine when F12 is pressed and it goes off and builds a complete server of any kind on my stack but I want to be able to initiate that with a transformation of the Ansible playbook below and have no idea how to do it after a pretty thorough review of documents on the Internet. If anyone knows how this can be accomplished and could comment, I’d sure appreciate it.

- hosts: 127.0.0.1  
connection: local  
user: root  
sudo: false  
gather\_facts: false  
serial: 1

tasks:

- vsphere\_guest:  
vcenter\_hostname: [sna-vcsa.SOMEDOMAIN.com](http://sna-vcsa.SOMEDOMAIN.com)  
username: ansible  
password: SOMEPASSWORD  
guest: SOMEHOSTNAME  
state: powered\_on  
vm\_extra\_config:  
vcpu.hotadd: yes  
mem.hotadd: yes  
vm\_disk:  
disk1:  
size\_gb: 100  
type: thin  
datastore: SOMEDATASTORE  
vm\_nic:  
nic1:  
type: vmxnet3  
network: SOMENETWORK  
network\_type: standard  
vm\_hardware:  
memory\_mb: 2048  
num\_cpus: 2  
osid: ubuntu64Guest  
scsi: paravirtual  
vm\_cdrom:  
type: “iso”  
iso\_path: “SOMEISODATASTORE/ISO/ubuntu-14.04.3-server-amd64.iso”  
esxi:  
datacenter: SNA  
hostname: [sna1.SOMEDOMAIN.com](http://sna1.SOMEDOMAIN.com)
