--
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-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/9d6a483a-90fb-4f17-a2df-45c0832971ec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
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:- template:src: <templatefile for virtual machine on control node>dest: <the destination on managed host>when: ansible_virtualization_role is defined or ansible_virtualization_role == "kvm"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
On Fri, 12 Apr 2019 at 17:50, Bruno Cochofel <bruno....@gmail.com> wrote:
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
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...@googlegroups.com.