- include: '{{ansible_distribution}}{{ansible_distribution_major_version}}.yml'
However, this is not allowed, as I discovered in the documentation.
Is there any way I can keep a single role, and make it work simply with both OS versions?
Regards,
Anand
The only issue for me is that ansible-playbook displays a skipped status for each task it doesn't run for a host instead of just ignoring them.
Another way to do this is to split your role in two, and have separate plays for CentOS 6 and 7. You can still have Ansible detect which host should run which play by grouping them with group_by:
--To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/166d68d8-9cae-4abd-ac97-be62bd5dc114%40email.android.com.
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.
For more options, visit https://groups.google.com/d/optout.
--
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/CANbPJF%3DECyU7OWjK2OXBwkKuLRb%3D635i85zM37_qTzF3pvsvVA%40mail.gmail.com.