Next, I am using the variable "{{ rhel8_9template.id }}" to feed in the template id to the template_library_item: parameter, part of the overall task.
- name: vm-create | Create virtual machine from Content Library
vmware.vmware_rest.vcenter_vmtemplate_libraryitems:
vcenter_hostname: "{{ hostname }}"
vcenter_password: "{{ survey_password }}"
vcenter_validate_certs: false
name: "{{ survey_vm_name }}"
library: "{{ library_id }}"
template_library_item: "{{ rhel8_9template.id }}"
This does work but I want to set a few more facts based on the available operating systems such as rhel9. I want to set a survey variable to allow admins to choose the OS to deploy.
I tried two variable syntax structure, neither seem to work. I need to pull the id from the respective OS.
template_library_item: "{{ vars['survey_os'].id }}"