Hi,
I’m trying to write a role that has different template file if the server is virtual os physical.
What’s the best way to filter this?
Thanks,
Bruno
Hi,
I’m trying to write a role that has different template file if the server is virtual os physical.
What’s the best way to filter this?
Thanks,
Bruno
I use these ansible facts for differentiating between physical and virtual guests:
“ansible_virtualization_role”: “guest”,
“ansible_virtualization_type”: “kvm”,
These work perfect along with a ‘when’ conditional. For example:
If you want to explore more variables, run the following adhoc command on both the physical and virtual hosts and notice the change is the value of variables that facts report:
ansible all -m setup | less
-R.Rao
Hi R.Rao,
Thanks, gonna try that
Bruno