Hi, community, 

I’m setting a fact there to grab the JSON dict of the template from the 
content library.

- name: vm-create | Use the name to identify library item
  set_fact:
    rhel8_9template: "{{ lib_items.value | selectattr('name', 'equalto', 
'rhel8-9template')|first }}"

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 }}"
template_library_item: "{{ survey_os[.id] }}"

What am I missing here?  Thanks!

-- 
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/d04eaa96-1b9c-4723-90d1-fb86184a694cn%40googlegroups.com.

Reply via email to