Skip to content

Commit b601f0f

Browse files
committed
Finally idempotence sorted out
1 parent bb3132e commit b601f0f

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

tasks/install.debian.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,36 @@
9797
notify:
9898
- reload systemd
9999

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

0 commit comments

Comments
 (0)