So we have a workiing deploment for our VM's using AAP.  What I am trying 
to do is as the last step after everything is done, is change the cd from 
the bootable iso file we use to kickstart everything, back to client 
device. I cannot figure out how.. 

What I have attempted to do (since I really don't know scripting) is edit 
one of the existing yml files which turns the VM on after all the infoblox 
and firewall objects are created..

Is there even a way using Ansible to just wait 30 min after the VM is 
powered on for it to do the full deploy, then set the CD-ROM back to client 
device?

---
- name: Create a new Virtual Machine in VMware
  hosts: localhost
  gather_facts: false
  vars:
    vcenter_hostname: '{{ lookup("env","VMWARE_HOST") }}'
    vcenter_username: '{{ lookup("env","VMWARE_USER") }}'
    vcenter_password: '{{ lookup("env","VMWARE_PASSWORD") }}'
  tasks:
    - name: "Look up the VM called {{ vm_name }} in the inventory"
      vmware.vmware_rest.vcenter_vm_info:
        filter_names:
        - "{{ vm_name }}"
      register: search_result
      
    - name: Collect information about a specific VM
      vmware.vmware_rest.vcenter_vm_info:
        vm: '{{ search_result.value[0].vm }}'
      register: test_vm1_info

    # - name: Pause for 30 for build to complete
    #   ansible.builtin.pause:
    #     minutes: 30

    - name: Set CD-ROM to Client Device
      community.vmware.vmware_guest:
        cdrom:
          type: client
        name: '{{ test_vm1_info.id }}'

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/4b377d13-1200-403c-a786-1748d47a56a1n%40googlegroups.com.

Reply via email to