# Feature Idea: Use role meta data to explicitly fail on an unsupported platform

**URL:** <https://forum.ansible.com/t/feature-idea-use-role-meta-data-to-explicitly-fail-on-an-unsupported-platform/17182>\
**Category:** Ansible Developer\
**Created:** [January 5, 2015, 8:13am UTC](https://forum.ansible.com/t/feature-idea-use-role-meta-data-to-explicitly-fail-on-an-unsupported-platform/17182 "2015-01-05T08:13:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gilles\_Cornu](https://avatars.discourse-cdn.com/v4/letter/g/ecccb3/32.png) [@Gilles\_Cornu](https://forum.ansible.com/u/Gilles_Cornu)\
**Post date:** [January 5, 2015, 8:13am UTC](https://forum.ansible.com/t/feature-idea-use-role-meta-data-to-explicitly-fail-on-an-unsupported-platform/17182/1 "2015-01-05T08:13:19Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [January 5, 2015, 1:48pm UTC](https://forum.ansible.com/t/feature-idea-use-role-meta-data-to-explicitly-fail-on-an-unsupported-platform/17182/2 "2015-01-05T13:48:41Z")

</div>

I think if we did this, it should be on all the time.

I’m wanting to control config option sprawl, as that’s more cognitive load on trying to figure out what to turn on, should I do this or not, best practices, etc.

However if the role doesn’t have metadata, it shouldn’t do anything to stop execution.

Ultimately, this needs to wait until the v2 refactoring tree is “live” so we don’t have a moving target to hit, but I’m open to the idea.

Thanks!

---

<div class="post-metadata">

**Author:** ![Gilles\_Cornu](https://avatars.discourse-cdn.com/v4/letter/g/ecccb3/32.png) [@Gilles\_Cornu](https://forum.ansible.com/u/Gilles_Cornu)\
**Post date:** [January 6, 2015, 1:53pm UTC](https://forum.ansible.com/t/feature-idea-use-role-meta-data-to-explicitly-fail-on-an-unsupported-platform/17182/3 "2015-01-06T13:53:35Z")

</div>

Thanks Michael for your positive feedback! If you agree, I’ll create a GitHub issue to keep this idea in the “TODO’s heap”, making it clear that its development requires v2 refactoring.
