Ansible playbook to deploy a VM in a PXEBOOT envrionment

259 views
Skip to first unread message

Stuart Cracraft

unread,
Feb 11, 2016, 7:19:13 PM2/11/16
to Ansible Project
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
      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

Reply all
Reply to author
Forward
0 new messages