The docs regarding template specificity indicate the OS is the only
criteria that can be used for dynamically choosing a template:

The pattern for file specificity is as follows:

host-node[:fqdn]

node[:platform]-node[:platform_version]

node[:platform]-version_components: The version string is split on
decimals and searched from greatest specificity to least; for example, if
the location from the last rule was centos-5.7.1, then centos-5.7 and
centos-5 would also be searched.

node[:platform]

default

Can I use other criteria? I would like to choose a template based on metal
vs VM.

The docs regarding template specificity indicate the OS is the only
criteria that can be used for dynamically choosing a template:

The pattern for file specificity is as follows:

host-node[:fqdn]

node[:platform]-node[:platform_version]

node[:platform]-version_components: The version string is split on
decimals and searched from greatest specificity to least; for example, if
the location from the last rule was centos-5.7.1, then centos-5.7 and
centos-5 would also be searched.

node[:platform]

default

Can I use other criteria? I would like to choose a template based on
metal vs VM.