Hi Alicia, The part that seems to be lacking for me is testing of inventory plugins (or plugins in general). My current assumption is I'll need to setup the ansible development environment and create a unit test.
Can you confirm if that is the case? Scripts were significantly easier, as I could just visually inspect the --list output of the script to confirm the json output etc. I cant seem to find a way to correctly call the inventory plugin to test all of its results. Specifically, most of the unit tests don't actually test calls to the inventory class. Such as inventory.add_host() etc. Thanks, Josh On Fri, Feb 1, 2019 at 9:46 AM alicia <acoz...@redhat.com> wrote: > Thanks Albert for your feedback on the documentation - I’m sorry it hasn’t > helped you achieve your goals. Do you remember where you got stuck? If so, > would you be willing to share the details so we can improve the docs? > > We’ve made quite a few changes recently to the main page about writing > inventory plugins ( > https://docs.ansible.com/ansible/devel/dev_guide/developing_inventory.html#developing-inventory) > and would welcome input in making it even more detailed and helpful. > > Josh, if you solve your challenges, I encourage you to contribute what you > learn back to the documentation so everyone can benefit from your > exploration. > > Feel free to respond via email or join the #ansible-docs IRC channel on > Freenode IRC. > > Thanks, > Alicia > > Alicia Cozine > Lead Technical Writer, Ansible by Red Hat > > On Jan 31, 2019, at 8:19 PM, Albert Autin <autin.alb...@gmail.com> wrote: > > I found the inventory script documentation (on how to create your own) to > be severely lacking.. :( i eventually gave up on trying it. > I hope you find an answer, but I just wanted to vent my frustration with > the docs here haha > > On Thu, Jan 31, 2019 at 8:00 AM Josh R <josh.robin...@gmail.com> wrote: > >> I'm writing an inventory plugin that gets a list of online machines from >> an active directory OU structure and dynamically creates groups and host >> details from it. >> >> However, as I write it - I'd like to be able to test the incremental >> changes by just calling parser() directly. >> >> Does anyone have an example call to parser() to test plugins? For >> example - my definition is : >> >> def parse(self, inventory, loader, path, cache=True): >> >> I temporarily removed all the required variables in order to call it, but >> I'm now at a point I need to test the inventory calls. >> >> Also. any guidance on testing of plugins would be appreciated. >> >> Thanks, >> >> Josh >> >> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Ansible Development" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to ansible-devel+unsubscr...@googlegroups.com. >> For more options, visit https://groups.google.com/d/optout. >> > > -- > You received this message because you are subscribed to the Google Groups > "Ansible Development" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to ansible-devel+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > > > -- You received this message because you are subscribed to the Google Groups "Ansible Development" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-devel+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.