# Contributing new plugin, adding libcloud as a dependency

**URL:** <https://forum.ansible.com/t/contributing-new-plugin-adding-libcloud-as-a-dependency/13139>\
**Category:** Ansible Project\
**Created:** [July 16, 2013, 9:35pm UTC](https://forum.ansible.com/t/contributing-new-plugin-adding-libcloud-as-a-dependency/13139 "2013-07-16T21:35:08Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eric\_Johnson](https://avatars.discourse-cdn.com/v4/letter/e/ed655f/32.png) [@Eric\_Johnson](https://forum.ansible.com/u/Eric_Johnson)\
**Post date:** [July 16, 2013, 9:35pm UTC](https://forum.ansible.com/t/contributing-new-plugin-adding-libcloud-as-a-dependency/13139/1 "2013-07-16T21:35:08Z")

</div>

Hi,

I’m considering contributing a new plugin to the Ansible community. Ideally, I’d like to use libcloud [[http://libcloud.apache.org](http://libcloud.apache.org)] but I believe this would introduce a new dependency so I wanted to check first. It may even be possible to standardize some of the plugins on libcloud (e.g. RAX, EC2, Linode, etc).

Any objections to at least introducing libcloud for the new plugin?

Cheers,  
Eric

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [July 17, 2013, 2:33pm UTC](https://forum.ansible.com/t/contributing-new-plugin-adding-libcloud-as-a-dependency/13139/2 "2013-07-17T14:33:18Z")

</div>

What is the plugin for if I may ask?

I am fine with modules having deps as long as they check for them and report if they aren’t available in clean ways.

I generally would /guess/ the native bindings might provide more options in many cases (boto, pyrax, etc), but I’d yield to the module authors in that regard.

---

<div class="post-metadata">

**Author:** ![Lester\_Wade](https://avatars.discourse-cdn.com/v4/letter/l/97f17d/32.png) [@Lester\_Wade](https://forum.ansible.com/u/Lester_Wade)\
**Post date:** [July 17, 2013, 2:41pm UTC](https://forum.ansible.com/t/contributing-new-plugin-adding-libcloud-as-a-dependency/13139/3 "2013-07-17T14:41:01Z")

</div>

Yes, I certainly wouldn’t consider moving away the AWS modules from boto in replacement of libcloud. It’s got a long long way to go.

---

<div class="post-metadata">

**Author:** ![Eric\_Johnson](https://avatars.discourse-cdn.com/v4/letter/e/ed655f/32.png) [@Eric\_Johnson](https://forum.ansible.com/u/Eric_Johnson)\
**Post date:** [July 19, 2013, 9:22pm UTC](https://forum.ansible.com/t/contributing-new-plugin-adding-libcloud-as-a-dependency/13139/4 "2013-07-19T21:22:16Z")

</div>

I’ve started messing around on a plugin for Google Compute Engine.

I have two likely options:

1. libcloud which was just recently updated to support GCE. Under the hood, it uses paramiko and pycrypto so I don’t think you’d see a lot of extra deps for ansible plugin users if this approach were taken.
2. Use google-api-python-client and oauth2client api but that introduces two top-level dependencies along with their own set of deps. This approach would have broader feature coverage than using libcloud (to Lester’s point).

I’m leaning toward libcloud at this point and it sounds like there are no real concerns as long as I do the proper checking.

---

<div class="post-metadata">

**Author:** ![Lester\_Wade](https://avatars.discourse-cdn.com/v4/letter/l/97f17d/32.png) [@Lester\_Wade](https://forum.ansible.com/u/Lester_Wade)\
**Post date:** [July 19, 2013, 9:33pm UTC](https://forum.ansible.com/t/contributing-new-plugin-adding-libcloud-as-a-dependency/13139/5 "2013-07-19T21:33:13Z")

</div>

I would go for (2). There will absolutely be features people want which libcloud doesn’t support.

---

<div class="post-metadata">

**Author:** ![Eric\_Johnson](https://avatars.discourse-cdn.com/v4/letter/e/ed655f/32.png) [@Eric\_Johnson](https://forum.ansible.com/u/Eric_Johnson)\
**Post date:** [July 19, 2013, 10:32pm UTC](https://forum.ansible.com/t/contributing-new-plugin-adding-libcloud-as-a-dependency/13139/6 "2013-07-19T22:32:33Z")

</div>

libcloud adheres to a minimal “contract” that it tries to maintain across all providers for each core service through a defined API and set of classes. It encourages additional features outside of that contract through “ex\_” methods. It also provides a lot of boilerplate functionality (retries, connection pools, etc) that are lacking with option 2.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [July 19, 2013, 11:38pm UTC](https://forum.ansible.com/t/contributing-new-plugin-adding-libcloud-as-a-dependency/13139/7 "2013-07-19T23:38:08Z")

</div>

Yeah a least common denominator solution would not be good.

I’d be very inclined to depend on the google client.

---

<div class="post-metadata">

**Author:** ![Eric\_Johnson](https://avatars.discourse-cdn.com/v4/letter/e/ed655f/32.png) [@Eric\_Johnson](https://forum.ansible.com/u/Eric_Johnson)\
**Post date:** [July 22, 2013, 3:12pm UTC](https://forum.ansible.com/t/contributing-new-plugin-adding-libcloud-as-a-dependency/13139/8 "2013-07-22T15:12:49Z")

</div>

I believe I’m doing a poor job arguing the case for using libcloud for adding GCE support to ansible. Please note that I’m only arguing the case for using libcloud to add GCE support; standardizing ansible on libcloud is _not_ my concern.

I truly believe the best way to accomplish adding GCE support in ansible is to use libcloud versus google-python-api-client. Please bear with me while I explain in more detail. Below is a feature comparison that I believe shows that libcloud more than covers all the use-cases an ansible user would care about. Furthermore, I’d make the case that libcloud provides _more_ functionality in the sense that it has authentication/authorization, SSH support, blocking/non-blocking calls, and convenience functions for creating/destroying multiple instances.

Feature libcloud google-api-python-client comments

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [July 22, 2013, 3:27pm UTC](https://forum.ansible.com/t/contributing-new-plugin-adding-libcloud-as-a-dependency/13139/9 "2013-07-22T15:27:20Z")

</div>

Perhaps using libcloud for this one is ok if it does what we need it to.

I do not want to see other modules switched to libcloud if it means we are not able to get features as quickly or we have to remove anything, i…e I don’t see us generically just using libcloud.

---

<div class="post-metadata">

**Author:** ![Eric\_Johnson](https://avatars.discourse-cdn.com/v4/letter/e/ed655f/32.png) [@Eric\_Johnson](https://forum.ansible.com/u/Eric_Johnson)\
**Post date:** [July 22, 2013, 3:37pm UTC](https://forum.ansible.com/t/contributing-new-plugin-adding-libcloud-as-a-dependency/13139/10 "2013-07-22T15:37:47Z")

</div>

Thanks Michael. I do want to provide a quality full-featured ansible plugin for GCE. Ideally, I’ll have something to show within the month.

---

<div class="post-metadata">

**Author:** ![Lester\_Wade](https://avatars.discourse-cdn.com/v4/letter/l/97f17d/32.png) [@Lester\_Wade](https://forum.ansible.com/u/Lester_Wade)\
**Post date:** [July 24, 2013, 8:26am UTC](https://forum.ansible.com/t/contributing-new-plugin-adding-libcloud-as-a-dependency/13139/11 "2013-07-24T08:26:11Z")

</div>

Ah, see that GCE example looks quite attractive. Question though: where the heck are the current libcloud docs? Even [http://libcloud.apache.org/apidocs/0.13.0/moduleIndex.html](http://libcloud.apache.org/apidocs/0.13.0/moduleIndex.html) doesn’t mention the GCE driver. Are Google working upstream in libcloud?

---

<div class="post-metadata">

**Author:** ![Eric\_Johnson](https://avatars.discourse-cdn.com/v4/letter/e/ed655f/32.png) [@Eric\_Johnson](https://forum.ansible.com/u/Eric_Johnson)\
**Post date:** [July 24, 2013, 12:11pm UTC](https://forum.ansible.com/t/contributing-new-plugin-adding-libcloud-as-a-dependency/13139/12 "2013-07-24T12:11:51Z")

</div>

Hmmm… Not sure how/when those docs are generated.

I’ve been using the [source for the gce driver](https://git-wip-us.apache.org/repos/asf?p=libcloud.git;a=blob;f=libcloud/compute/drivers/gce.py;h=c46b66de063067c384d62d42641a84e278c1ae70;hb=HEAD) along with the [demo script](https://git-wip-us.apache.org/repos/asf?p=libcloud.git;a=blob;f=demos/gce_demo.py;h=92a31b200856f8da7a7317927d66a34164a8c4bf;hb=HEAD) as “documentation”. When my colleague that contributed the work returns from vacation I’ll ask him to follow up with the upstream team about getting their api docs updated. The GCE work is a very recent addition having just been accepted on [12-Jul](https://git-wip-us.apache.org/repos/asf?p=libcloud.git;a=commit;h=b0782175a3546bbd0dae67f383c0f6884e8a1c94).
