drone-plugins / drone-ansible

Drone plugin to provision via Ansible
http://plugins.drone.io/drone-plugins/drone-ansible
Apache License 2.0
30 stars 41 forks source link

Update Ansible version and install boto #26

Closed mtb-xt closed 4 years ago

mtb-xt commented 4 years ago

Hello.

This PR updates Ansible version to the latest minor version, it also adds boto libraries which are required for every aws-related module (and for dynamic inventories too...)

mtb-xt commented 4 years ago

Could anyone merge it pls?

techknowlogick commented 4 years ago

@tboerger seems I don't have merge permissions.

tboerger commented 4 years ago

Updating ansible is totally fine, but I'm not sure about boto install, so far we are installing only requests via the alpine package.

In theory you could also just use the requirements attribute within drone to install dependencies for your use case in the standard requirements.txt format.

Besides that I need to check if we got a tagged release for the previous version :)

mtb-xt commented 4 years ago

@tboerger ansible's aws modules are unusable without boto included.

are you saying I need to run pip install -r requirements.txt inside the plugin every time it runs?

Then this plugin is useless <_< What's the point of having only partially-working ansible plugin?

tboerger commented 4 years ago

The plugin is doing the pip install automatically if you provide a path to a requirements.txt.

And this plugin is even in that case not useless as it's working pretty well. It just doesn't install all possible python modules.

The plugin isn't working partially. But how should we cover every possible dynamic inventory hacking? I'm using dynamic inventory pretty much (not on aws) without the need to install any additional module.

mtb-xt commented 4 years ago

re - requirements.txt - it still means a delay and unnecessary downloads every time a step with this plugin runs.

I apologize for the tone, but really, using AWS for dynamic inventories and to manipulate AWS resources would seem a pretty common Ansible use-case, not a hacking.

I guess we can always build our own image of the plugin, but in my opinion, that makes drone much less usable.

EDIT: What's wrong with including most common python modules, that Ansible needs? Even if plugin image becomes bigger, it's downloaded once and stays in docker image cache. Installing requirements would happen every time.

tboerger commented 4 years ago

Generally it's encouraged to fork the plugins and add custom logic that is required for individuals.

After thinking about it I'm fine to add required dependencies for the 3 big major cloud providers aws, gcp and azure.

But instead of installing these deps via pip directly I would prefer the alpine packages for it, e.g. py-boto, similar to py-requests.

I will also soonish tag a new release and upgrade python to version 3 as 2.7 will reach eol more or less soon.

mtb-xt commented 4 years ago

py-boto is boto 2 in alpine. py3-boto3 and py3-botocore are only available in testing AFAIK

you want me to update the PR, or wait till you update it to python3?

tboerger commented 4 years ago

If these modules are only packaged for python3 we should do the upgrade first.

tboerger commented 4 years ago

I have tagged the current plugin as v1.3.0, now I have created a PR to upgrade python to version 3. After merging my PR I will tag it as v2.0.0: https://github.com/drone-plugins/drone-ansible/pull/27

tboerger commented 4 years ago

Ah, and after merging my PR you only got to add py3-boto behind py3-requests :)