I will try to explain this as clearly as I can, so I don’t have to transcribe a bunch Ansible syntax from our internal system to here. We have been a single-OS shop for years, but a new manager wants us to offer other OS’s to users, such as Ubuntu and Debian (possibly more to come). Our build playbook looked complex but was pretty straightforward, since it was just calling for different configurations of the same Rocky OS (cli, GUI, pre-configured for GPU). Here is the snippet that calls the specific vmware template type:
vmware_linux_golden_template: '{% if gpu_profile is defined %}{{ vgpu | selectattr("profile", "match", gpu_profile) | map(attribute="template") | join }}{% elif has_gnome %}{{vmware selectattr("cluster", "match", vmware_cluster) | map(attribute="gui_template") | join }}{%else %}{{vmware | selectattr("cluster", "match", vmware_cluster) | map(attribute="cli_template") | join }}{% endif %}'
The variables there are either pulled from …/all/vars.yml or are specified further down the line in the group_vars for each specific project. The above template selection can get a little cumbersome and messy when additional OS’s are added, so I wanted to ask what are some ways to easily present multiple OS’s to select from for our admins and engineers when creating new VM’s?
I’ve tried creating a numbered list of VMware templates to choose from and was able to get a list to present, but could not figure out why only a single template was being used regardless of the number chosen. I’m fine removing the above line and using something completely different, so long as the alternative can easily be modified when a new OS is approved for use.