Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pip role #204

Closed
wants to merge 1 commit into from
Closed

Add pip role #204

wants to merge 1 commit into from

Conversation

cognifloyd
Copy link
Member

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.

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
Copy link
Member

arm4b commented Oct 1, 2018

As I understand to add Mongo users in #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
Copy link
Member Author

Works for me.

@cognifloyd cognifloyd closed this Oct 1, 2018
@arm4b
Copy link
Member

arm4b commented Oct 1, 2018

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

@cognifloyd
Copy link
Member Author

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
Copy link
Member

arm4b commented Oct 1, 2018

Alright then!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants