StackStorm / ansible-st2

Ansible Roles and Playbooks to deploy StackStorm
https://galaxy.ansible.com/StackStorm/stackstorm/
Apache License 2.0
100 stars 75 forks source link

Add pip role #204

Closed cognifloyd closed 6 years ago

cognifloyd commented 6 years ago

This embeds the pip role from https://github.com/bobbyrenwick/ansible-pip

The role is licensed under Apache 2.0.

A follow up PR will add the role to the playbook wherever necessary. It is important to make sure pip is installed on the managed host for these reasons:

  1. If an ansible module has any python dependencies, those need to be installed with whatever python ansible is using on the managed host.
  2. Installing those dependencies as system packages, instead of using pip to install them, will often install very outdated packages.
  3. Pip is a very basic package that most systems need anyway.
  4. Pretty pretty please with a cherry on top.

Background: I want to use the mongodb_* ansible modules in a follow up PR, but they require the pymongo python module. The containers containers used in Travis do not have pip by default, so to get a new enough verision of pymongo installed, I need to install pip first.

arm4b commented 6 years ago

As I understand to add Mongo users in https://github.com/StackStorm/ansible-st2/pull/162 we need to use https://docs.ansible.com/ansible/2.5/modules/mongodb_user_module.html Ansible module, which requires pymongo. And here you're adding pip role to install pymongo python package.

Let's escape this rabbit hole.

As Ansible module needs 2.5+ of pymongo according to https://docs.ansible.com/ansible/2.5/modules/mongodb_user_module.html, can we install it via yum/apt packages? I've checked 2 weakest from the OSes we support and CentOS6 has python-pymongo v2.5.2, while Ubuntu14 has pyhon-pymongo v2.6.3.

So can we just use OS-level packages python-pymongo at keep it easy?

cognifloyd commented 6 years ago

Works for me.

arm4b commented 6 years ago

Cool, worth updating #162 then and so we also get rid of requirements.txt dependency.

cognifloyd commented 6 years ago

I already dropped requirements in that PR. This was my attempt to add a role to install pip more cleanly than the couple of tasks I replaced the requirements with in there. I closed #162 anyway. #205 contains the next step towards adding mongo auth.

arm4b commented 6 years ago

Alright then!