File tree Expand file tree Collapse file tree 3 files changed +3
-33
lines changed Expand file tree Collapse file tree 3 files changed +3
-33
lines changed Original file line number Diff line number Diff line change 1
1
#!/usr/bin/python
2
2
3
- # (c) 2015-2018 , Sergei Antipov, 2GIS LLC
3
+ # (c) 2015-2021 , Sergei Antipov
4
4
#
5
5
# This file is part of Ansible
6
6
#
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ provisioner:
31
31
inventory :
32
32
host_vars :
33
33
mongo1 :
34
+ ansible_python_interpreter : auto_silent
34
35
mongodb_master : true
35
36
mongodb_replication_params :
36
37
- host_name : " {{ hostvars[inventory_hostname].ansible_default_ipv4.address }}"
Original file line number Diff line number Diff line change 97
97
notify :
98
98
- reload systemd
99
99
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
-
108
100
- name : Install PyMongo package
109
101
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' }}"
You can’t perform that action at this time.
0 commit comments