In your main.yml put in include_tasks: windows.yml when the host is Windows and include_tasks: unix.yml when it is not. You can use the gathered facts to do this or you can have a variable that can be set when running on Windows by the end user.
Personally I think you should still split the role into 2, Windows is really not interoperable with the Unix side and they use their own modules. You would get quite a large and messy role when trying to handle both and it could become quite complex when implementing and documenting features that one supports and the other doesn't. I had a lot of success doing this previously where there would be a java role and I would create a win-java role which tried to implement the same functionality where I could. -- 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-project+unsubscr...@googlegroups.com. To post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/f776c1bc-3b75-4ce8-b7bc-c0b4571df329%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.