File tree Expand file tree Collapse file tree 7 files changed +40
-14
lines changed Expand file tree Collapse file tree 7 files changed +40
-14
lines changed Original file line number Diff line number Diff line change 28
28
29
29
- name : Install PyMongo package
30
30
yum :
31
- name : python-pymongo
31
+ name : " {{ mongodb_pymongo_package }} "
32
32
state : present
33
33
lock_timeout : " {{ yum_lock_timeout }}"
34
34
when : not mongodb_pymongo_from_pip
35
35
36
36
- name : Install PIP
37
37
yum :
38
- name :
39
- - python-devel
40
- - python-pip
38
+ name : " {{ mongodb_pymongo_deps }}"
41
39
lock_timeout : " {{ yum_lock_timeout }}"
42
40
when : mongodb_pymongo_from_pip
43
41
46
44
name : pymongo
47
45
state : " {{ mongodb_pymongo_pip_version is defined | ternary('present', 'latest') }}"
48
46
version : " {{ mongodb_pymongo_pip_version | default(omit) }}"
47
+ executable : " {{ mongodb_pip_executable }}"
49
48
when : mongodb_pymongo_from_pip
Original file line number Diff line number Diff line change 106
106
107
107
- name : Install PyMongo package
108
108
apt :
109
- name : " {{ 'python-pymongo' if ansible_facts['python'].version.major == 2 else 'python3-pymongo' }}"
109
+ name : " {{ mongodb_pymongo_package }}"
110
110
when : not mongodb_pymongo_from_pip
111
111
112
112
- name : Install PIP
113
113
apt :
114
- pkg :
115
- - python-dev
116
- - python-pip
114
+ pkg : " {{ mongodb_pymongo_deps }}"
117
115
when : mongodb_pymongo_from_pip | bool
118
116
119
117
# TODO: check if it is still needed for Debian/Ubuntu
120
118
- name : Install setuptools (required for ansible 2.7+)
121
119
apt :
122
- pkg :
123
- - python-setuptools
120
+ pkg : " {{ mongodb_python_setuptools }}"
124
121
when : mongodb_pymongo_from_pip | bool
125
122
126
123
- name : Install PyMongo from PIP
129
126
- pymongo
130
127
state : " {{ mongodb_pymongo_pip_version is defined | ternary('present', 'latest') }}"
131
128
version : " {{ mongodb_pymongo_pip_version | default(omit) }}"
129
+ executable : " {{ mongodb_pip_executable }}"
132
130
when : mongodb_pymongo_from_pip | bool
Original file line number Diff line number Diff line change 34
34
35
35
- name : Install PyMongo package
36
36
yum :
37
- name : python-pymongo
37
+ name : " {{ mongodb_pymongo_package }} "
38
38
state : present
39
39
lock_timeout : " {{ yum_lock_timeout }}"
40
40
when : not mongodb_pymongo_from_pip
41
41
42
42
- name : Install PIP
43
43
yum :
44
- name :
45
- - python-devel
46
- - python-pip
44
+ name : " {{ mongodb_pymongo_deps }}"
47
45
lock_timeout : " {{ yum_lock_timeout }}"
48
46
when : mongodb_pymongo_from_pip | bool
49
47
52
50
name : pymongo
53
51
state : " {{ mongodb_pymongo_pip_version is defined | ternary('present', 'latest') }}"
54
52
version : " {{ mongodb_pymongo_pip_version | default(omit) }}"
53
+ executable : " {{ mongodb_pip_executable }}"
55
54
when : mongodb_pymongo_from_pip | bool
Original file line number Diff line number Diff line change @@ -12,3 +12,10 @@ mongodb_repository_gpgkey:
12
12
mongodb_pidfile_path : " {{ '/var/run/mongodb/mongod.pid' if ('mongodb-org' in mongodb_package) else '' }}"
13
13
14
14
yum_lock_timeout : 180
15
+
16
+ mongodb_pymongo_package : " {{ 'python3-pymongo' if ansible_python_interpreter is search('python3') | bool else 'python-pymongo' }}"
17
+ mongodb_pymongo_deps :
18
+ - " {{ 'python3-devel' if ansible_python_interpreter is search('python3') | bool else 'python-devel' }}"
19
+ - " {{ 'python3-pip' if ansible_python_interpreter is search('python3') | bool else 'python-pip' }}"
20
+ mongodb_pip_executable : " {{ 'pip3' if ansible_python_interpreter is search('python3') | bool else 'pip' }}"
21
+
Original file line number Diff line number Diff line change @@ -3,3 +3,11 @@ mongodb_repository:
3
3
" 3.6 " : " deb http://repo.mongodb.org/apt/debian {{ ansible_distribution_release }}/mongodb-org/3.6 main"
4
4
" 4.0 " : " deb http://repo.mongodb.org/apt/debian {{ ansible_distribution_release }}/mongodb-org/4.0 main"
5
5
" 4.2 " : " deb http://repo.mongodb.org/apt/debian {{ ansible_distribution_release }}/mongodb-org/4.2 main"
6
+
7
+ mongodb_pymongo_package : " {{ 'python3-pymongo' if ansible_python_interpreter is search('python3') | bool else 'python-pymongo' }}"
8
+ mongodb_pymongo_deps :
9
+ - " {{ 'python3-dev' if ansible_python_interpreter is search('python3') | bool else 'python-dev' }}"
10
+ - " {{ 'python3-pip' if ansible_python_interpreter is search('python3') | bool else 'python-pip' }}"
11
+ mongodb_python_setuptools : " {{ 'python3-setuptools' if ansible_python_interpreter is search('python3') | bool else 'python-setuptools' }}"
12
+ mongodb_pip_executable : " {{ 'pip3' if ansible_python_interpreter is search('python3') | bool else 'pip' }}"
13
+
Original file line number Diff line number Diff line change @@ -12,3 +12,10 @@ mongodb_repository_gpgkey:
12
12
mongodb_pidfile_path : " {{ '/var/run/mongodb/mongod.pid' if ('mongodb-org' in mongodb_package) else '' }}"
13
13
14
14
yum_lock_timeout : 180
15
+
16
+ mongodb_pymongo_package : " {{ 'python3-pymongo' if ansible_python_interpreter is search('python3') | bool else 'python-pymongo' }}"
17
+ mongodb_pymongo_deps :
18
+ - " {{ 'python3-devel' if ansible_python_interpreter is search('python3') | bool else 'python-devel' }}"
19
+ - " {{ 'python3-pip' if ansible_python_interpreter is search('python3') | bool else 'python-pip' }}"
20
+ mongodb_pip_executable : " {{ 'pip3' if ansible_python_interpreter is search('python3') | bool else 'pip' }}"
21
+
Original file line number Diff line number Diff line change @@ -3,3 +3,11 @@ mongodb_repository:
3
3
" 3.6 " : " deb http://repo.mongodb.org/apt/ubuntu {{ ansible_distribution_release }}/mongodb-org/3.6 multiverse"
4
4
" 4.0 " : " deb http://repo.mongodb.org/apt/ubuntu {{ ansible_distribution_release }}/mongodb-org/4.0 multiverse"
5
5
" 4.2 " : " deb http://repo.mongodb.org/apt/ubuntu {{ ansible_distribution_release }}/mongodb-org/4.2 multiverse"
6
+
7
+ mongodb_pymongo_package : " {{ 'python3-pymongo' if ansible_python_interpreter is search('python3') | bool else 'python-pymongo' }}"
8
+ mongodb_pymongo_deps :
9
+ - " {{ 'python3-dev' if ansible_python_interpreter is search('python3') | bool else 'python-dev' }}"
10
+ - " {{ 'python3-pip' if ansible_python_interpreter is search('python3') | bool else 'python-pip' }}"
11
+ mongodb_python_setuptools : " {{ 'python3-setuptools' if ansible_python_interpreter is search('python3') | bool else 'python-setuptools' }}"
12
+ mongodb_pip_executable : " {{ 'pip3' if ansible_python_interpreter is search('python3') | bool else 'pip' }}"
13
+
You can’t perform that action at this time.
0 commit comments