Instead of having to write a “check task” for each role like
`
- name: Check for unsupported platform
fail: msg=“The operating system {{ ansible_distribution }} / {{ ansible_os_family }}) is not currently supported.”
when: "ansible_os_family not in [‘Darwin’, ‘Debian’, ‘RedHat’]"¬
`
ansible could (optionally be configured to) apply a “support check up” based on the platforms information (names and versions) defined in role’s meta/main.yml
.
Note that this “auto-check” feature should be optional or easily overridable, because in some context you might prefer to not check anything or have different support conditions (e.g. support ansible_distribution ‘MacOSX’ but not necessarily the “whole” ansible_os_family ‘Darwin’), which might be not present in role meta data.
I know this is a little added value, but I think it could help to make roles look nicer and encourage good practices in meta data usage. Looking forward to reading your feedbacks
Best regards and a Happy New Year 2015 to everybody!
Gilles