# Override platform/distribution for module subclass selection?

**URL:** <https://forum.ansible.com/t/override-platform-distribution-for-module-subclass-selection/7437>\
**Category:** Get Help\
**Created:** [July 23, 2024, 7:18pm UTC](https://forum.ansible.com/t/override-platform-distribution-for-module-subclass-selection/7437 "2024-07-23T19:18:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![LoftyGoals](https://avatars.discourse-cdn.com/v4/letter/l/da6949/32.png) [@LoftyGoals](https://forum.ansible.com/u/LoftyGoals)\
**Post date:** [July 23, 2024, 7:18pm UTC](https://forum.ansible.com/t/override-platform-distribution-for-module-subclass-selection/7437/1 "2024-07-23T19:18:49Z")

</div>

I’m running Ansible against a remote TinyCoreLinux host (running inside QEMU but I think that doesn’t matter). When I try to use ansible.builtin.group, it selects the wrong module subclass. I believe this is because platform.system() == ‘Linux’, /etc/os-release.ID == ‘TinyCore’, and TinyCore is not supported by module\_utils.

I’ve tried overriding various hostvars but an inspection of get\_platform\_subclass() tells me that there is no hook for overriding distro.id() when there is a value in /etc/os-release.

The actual goal is to trigger the BusyBox subclass because that’s what TCL uses. I don’t think it makes sense for me to submit a new distribution for support.

Before I muck with /etc/os-release to trick Ansible into thinking it’s running on Alpine, is there any cleaner way to do this?

Thank you!

– Salvatore  
smile.

---

<div class="post-metadata">

**Author:** ![utoddl](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/utoddl/32/249_2.png) [@utoddl](https://forum.ansible.com/u/utoddl)\
**Post date:** [July 23, 2024, 10:35pm UTC](https://forum.ansible.com/t/override-platform-distribution-for-module-subclass-selection/7437/2 "2024-07-23T22:35:25Z")

</div>

Hmm. Can you show us the rest of your `/etc/os-release`?  
Also, which sub-class is it selecting?

---

<div class="post-metadata">

**Author:** ![LoftyGoals](https://avatars.discourse-cdn.com/v4/letter/l/da6949/32.png) [@LoftyGoals](https://forum.ansible.com/u/LoftyGoals)\
**Post date:** [July 23, 2024, 10:39pm UTC](https://forum.ansible.com/t/override-platform-distribution-for-module-subclass-selection/7437/3 "2024-07-23T22:39:59Z")

</div>

NAME=TinyCore  
VERSION=“15.0”  
ID=tinycore  
VERSION\_ID=15.0  
PRETTY\_NAME=“TinyCoreLinux 15.0”  
ANSI\_COLOR=“0;34”  
CPE\_NAME=“cpe:/o:tinycore:tinycore\_linux:15.0”  
HOME\_URL=“[http://tinycorelinux.net/](http://tinycorelinux.net/)”  
SUPPORT\_URL=“[http://forum.tinycorelinux.net/](http://forum.tinycorelinux.net/)”  
BUG\_REPORT\_URL=“[http://forum.tinycorelinux.net/](http://forum.tinycorelinux.net/)”

I’m not sure how to identify the subclass but from code inspection I believe it is the generic Linux one. I can try to hand-modify the module code but I probably can’t do that tonight.
