"Cut-n-paste the entire group.py and user.py files into a custom module, minus the trouble of having to write it myself. "
Well, to answer the original question, extension in Ansible modules happens by module_utils/*.py, which exists in the main repo. So ansible does have a facility for sharing common code. Normal remote modules however, cannot be trivially subclassed. (This does not apply to action plugins, but that's not helpful to your question in this case) On Mon, Jan 5, 2015 at 7:26 AM, Alan Ray <[email protected]> wrote: > A good point. I'm not exactly sure how that helps me, though. It seems > like my options are: > 1. Cut-n-paste the entire group.py and user.py files into a custom module, > minus the trouble of having to write it myself. > 2. Wait for the merge conflicts to be resolved and for this to make it > into some sort of development release. > 3. Put together a custom build and installation of Ansible. > > It seems like what I want to do in the short-term is extend the core > module. Is there a way to extend the core module for just OS X without > cut-n-pasting the entire user module? > > (I realize I'm repeating my question from my original post here, but I'm > not seeing how the pull request changes the situation other than it means I > don't have to write the Darwin implementations myself.) > > Thanks, > Alan > > On Friday, December 26, 2014 1:49:55 AM UTC-5, Chris Church wrote: >> >> There's already an open PR to support OS X: https://github.com/ansible/ >> ansible-modules-core/pull/66 >> >> >> On Mon, Dec 22, 2014 at 6:45 PM, Alan Ray <[email protected]> wrote: >> >>> I'm looking to extend the core user module to work (at least partially) >>> with OS X (Darwin). The nearest discussion I can find is about 18 months >>> old (https://groups.google.com/forum/#!searchin/ansible- >>> project/extend$20module/ansible-project/7SByPqJxa7Q/NVeOAWdAio4J) and >>> is pretty negative about the possibility of extending a core module. >>> >>> However, I notice that core user module seems to have extensibility >>> built in since it automatically selects the best class based on the >>> platforms/distributions defined in the subclasses. Short of cut-n-pasting >>> the whole user module (1500 lines of code), is there a way of just writing >>> the OS X extension and having it be automatically loaded for OS X platforms? >>> >>> Thanks, >>> Alan >>> >>> -- >>> 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 [email protected]. >>> To post to this group, send email to [email protected]. >>> To view this discussion on the web visit https://groups.google.com/d/ >>> msgid/ansible-project/d80faeef-208c-445c-89e8- >>> 4ffe6b10f4a1%40googlegroups.com >>> <https://groups.google.com/d/msgid/ansible-project/d80faeef-208c-445c-89e8-4ffe6b10f4a1%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> -- > 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 [email protected]. > To post to this group, send email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/70a7d276-d5e4-4d25-aeb6-9f766c6941ae%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-project/70a7d276-d5e4-4d25-aeb6-9f766c6941ae%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- 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 [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgwb2%3DKF6w%3D_vnYcO4dPXNz%3Dtu4wdO16Ly3KB63xxmg40A%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
