Skip to content

Commit bb3132e

Browse files
committed
Do not install pymongo from pip
1 parent a9c403e commit bb3132e

File tree

3 files changed

+3
-33
lines changed

3 files changed

+3
-33
lines changed

library/mongodb_replication.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/python
22

3-
# (c) 2015-2018, Sergei Antipov, 2GIS LLC
3+
# (c) 2015-2021, Sergei Antipov
44
#
55
# This file is part of Ansible
66
#

molecule/default/molecule.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ provisioner:
3131
inventory:
3232
host_vars:
3333
mongo1:
34+
ansible_python_interpreter: auto_silent
3435
mongodb_master: true
3536
mongodb_replication_params:
3637
- host_name: "{{ hostvars[inventory_hostname].ansible_default_ipv4.address }}"

tasks/install.debian.yml

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -97,37 +97,6 @@
9797
notify:
9898
- reload systemd
9999

100-
# workaround for the issue with pip idempotency
101-
- name: Forcefully set mongodb_pymongo_from_pip to true on Debian 10
102-
set_fact:
103-
mongodb_pymongo_from_pip: false
104-
when:
105-
- ansible_distribution == 'Debian'
106-
- ansible_distribution_release == 'buster'
107-
108100
- name: Install PyMongo package
109101
apt:
110-
name: python-pymongo
111-
when: not mongodb_pymongo_from_pip
112-
113-
- name: Install PIP
114-
apt:
115-
pkg:
116-
- python-dev
117-
- python-pip
118-
when: mongodb_pymongo_from_pip | bool
119-
120-
# TODO: check if it is still needed for Debian/Ubuntu
121-
- name: Install setuptools (required for ansible 2.7+)
122-
apt:
123-
pkg:
124-
- python-setuptools
125-
when: mongodb_pymongo_from_pip | bool
126-
127-
- name: Install PyMongo from PIP
128-
pip:
129-
name:
130-
- pymongo
131-
state: "{{ mongodb_pymongo_pip_version is defined | ternary('present', 'latest') }}"
132-
version: "{{ mongodb_pymongo_pip_version | default(omit) }}"
133-
when: mongodb_pymongo_from_pip | bool
102+
name: "{{ 'python-pymongo' if ansible_facts['python'].version.major == 2 else 'python3-pymongo' }}"

0 commit comments

Comments
 (0)