This is more of a topic for ansible-project. In many cases Ansible doesn't wish to add extra dependencies for remote modules and the CLI commands are sufficient.
In other cases, we want to do something a lot more involved (like work with OpenStack) where the library is the most logical and stable option. It all depends basically. In some cases, an underlying API may be very fragile by platform - basically rarely updated random packages on PyPi are not things we like to link against, nor do we like to use packages that are not available in EPEL. We almost never try to parse output, but it's fine to shell out to a Unix command and interrogate a return code, and keeps our dependencies down and in many cases the app is more reliable. On Sun, May 25, 2014 at 7:21 AM, Mathew Davies < [email protected]> wrote: > So I was thinking about some of the modules implemented in ansible. > > A few of them just proxy through to unix commands while others will use a > Python API when it exists. Can someone explain the advantages and > disadvantages for both? > > I can only think of an API being more programmer friendly for getting back > return codes, calling functions instead of commands etc ... > > Am I missing other points? I'm writing a few modules and don't want to > feel bad for writing a command proxy when I could spend time writing a > python API for my needs. > > Kind Regards, > -Mathew Davies. > > -- > 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/CAN9G7bp0zibVn-5vWKwVNAh2RQSD9yyS%3DwmO22hyxKJnsaU2cw%40mail.gmail.com<https://groups.google.com/d/msgid/ansible-project/CAN9G7bp0zibVn-5vWKwVNAh2RQSD9yyS%3DwmO22hyxKJnsaU2cw%40mail.gmail.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%2BnsWgwn%2BrXQmK0i84hAm%2BKdVgzwENSv7Fb6Hjwnyf5kBwEH5Q%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
