Closed cognifloyd closed 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?
Works for me.
Cool, worth updating #162 then and so we also get rid of requirements.txt dependency.
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.
Alright then!
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:
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.