How to use the DarwinUser class from the user module?

Hello,

I am trying to extend a custom role that involves creating and setting up user accounts to work on MacOSX. After looking at the source code of the user module, I found the DarwinUser subclass defined (https://github.com/ansible/ansible-modules-core/blob/devel/system/user.py#L1396). But the main function just initializes an object of the User class. Is it possible to tell the module to use the DarwinUser class instead of User? What’s the recommended way to use the subclasses that are defined?

Thanks,
Vineet

That happens automatically when running on OS X:
https://github.com/ansible/ansible-modules-core/blob/devel/system/user.py#L249
https://github.com/ansible/ansible/blob/devel/lib/ansible/module_utils/basic.py#L224

Ok, just realized that the DarwinUser subclass has been added in relatively newer version of ansible where as we are using an older version in which the subclass doesn’t exist which is the reason why the module didn’t work automatically.

Thanks.