Skip to content

Commit 4530905

Browse files
authored
Merge pull request #155 from fllaca/v4.0-fix-tests
Support V4.0
2 parents bb1b10b + 7c0d099 commit 4530905

8 files changed

Lines changed: 46 additions & 40 deletions

File tree

.travis.yml

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ language: python
77
python:
88
- "2.7"
99
env:
10+
- >
11+
DISTRIBUTION=ubuntu
12+
DIST_VERSION=18_04-builded
13+
MONGODB_VERSION=4.0
14+
MONGODB_PACKAGE=mongodb
1015
- >
1116
DISTRIBUTION=ubuntu
1217
DIST_VERSION=18_04-builded
@@ -15,72 +20,72 @@ env:
1520
- >
1621
DISTRIBUTION=ubuntu
1722
DIST_VERSION=16_04-builded
18-
MONGODB_VERSION=3.6
23+
MONGODB_VERSION=4.0
1924
- >
2025
DISTRIBUTION=ubuntu
2126
DIST_VERSION=16_04-builded
22-
MONGODB_VERSION=3.4
27+
MONGODB_VERSION=3.6
2328
- >
2429
DISTRIBUTION=ubuntu
2530
DIST_VERSION=16_04-builded
26-
MONGODB_VERSION=3.2
31+
MONGODB_VERSION=3.4
2732
- >
2833
DISTRIBUTION=ubuntu-upstart
2934
DIST_VERSION=14.04
30-
MONGODB_VERSION=3.6
35+
MONGODB_VERSION=4.0
3136
- >
3237
DISTRIBUTION=ubuntu-upstart
3338
DIST_VERSION=14.04
34-
MONGODB_VERSION=3.4
39+
MONGODB_VERSION=3.6
3540
- >
3641
DISTRIBUTION=ubuntu-upstart
3742
DIST_VERSION=14.04
38-
MONGODB_VERSION=3.2
43+
MONGODB_VERSION=3.4
3944
- >
4045
DISTRIBUTION=debian
4146
DIST_VERSION=9-builded
42-
MONGODB_VERSION=3.6
47+
MONGODB_VERSION=4.0
4348
- >
4449
DISTRIBUTION=debian
4550
DIST_VERSION=9-builded
46-
MONGODB_VERSION=3.2
51+
MONGODB_VERSION=3.6
4752
MONGODB_PACKAGE=mongodb
4853
- >
4954
DISTRIBUTION=debian
5055
DIST_VERSION=8-builded
51-
MONGODB_VERSION=3.6
56+
MONGODB_VERSION=4.0
5257
- >
5358
DISTRIBUTION=debian
5459
DIST_VERSION=8-builded
55-
MONGODB_VERSION=3.4
60+
MONGODB_VERSION=3.6
5661
- >
5762
DISTRIBUTION=debian
5863
DIST_VERSION=8-builded
59-
MONGODB_VERSION=3.2
64+
MONGODB_VERSION=3.4
6065
- >
6166
DISTRIBUTION=centos
6267
DIST_VERSION=6-builded
63-
MONGODB_VERSION=3.6
68+
MONGODB_VERSION=4.0
6469
- >
6570
DISTRIBUTION=centos
6671
DIST_VERSION=6-builded
67-
MONGODB_VERSION=3.4
72+
MONGODB_VERSION=3.6
6873
- >
6974
DISTRIBUTION=centos
7075
DIST_VERSION=6-builded
71-
MONGODB_VERSION=3.2
76+
MONGODB_VERSION=3.4
7277
- >
7378
DISTRIBUTION=centos
7479
DIST_VERSION=7-builded
75-
MONGODB_VERSION=3.6
80+
MONGODB_VERSION=4.0
7681
- >
7782
DISTRIBUTION=centos
7883
DIST_VERSION=7-builded
79-
MONGODB_VERSION=3.4
84+
MONGODB_VERSION=3.6
8085
- >
8186
DISTRIBUTION=centos
8287
DIST_VERSION=7-builded
83-
MONGODB_VERSION=3.2
88+
MONGODB_VERSION=3.4
8489
8590
services:
8691
- docker

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ Ansible role which manages [MongoDB](http://www.mongodb.org/).
1010

1111
MongoDB support matrix:
1212

13-
| Distribution | < MongoDB 3.0 | MongoDB 3.2 | MongoDB 3.4 | MongoDB 3.6 |
14-
| ------------ |:-------------:|:-----------:|:-----------:|:-----------:|
15-
| Ubuntu 14.04 | :no_entry: | :white_check_mark:| :white_check_mark:| :white_check_mark:|
16-
| Ubuntu 16.04 | :no_entry: | :white_check_mark:| :white_check_mark:| :white_check_mark:|
17-
| Ubuntu 18.04 | :no_entry: | :x:| :x:| :white_check_mark:|
18-
| Debian 8.x | :no_entry: | :white_check_mark:| :white_check_mark:| :white_check_mark:|
19-
| Debian 9.x | :no_entry: | :white_check_mark:| :x:| :white_check_mark:|
20-
| RHEL 6.x | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark:|
21-
| RHEL 7.x | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark:|
13+
| Distribution | < MongoDB 3.0 | MongoDB 3.2 | MongoDB 3.4 | MongoDB 3.6 | MongoDB 4.0 |
14+
| ------------ |:-------------:|:-----------:|:-----------:|:-----------:|:-----------:|
15+
| Ubuntu 14.04 | :no_entry: | :no_entry:| :white_check_mark:| :white_check_mark:| :white_check_mark:|
16+
| Ubuntu 16.04 | :no_entry: | :no_entry:| :white_check_mark:| :white_check_mark:| :white_check_mark:|
17+
| Ubuntu 18.04 | :no_entry: | :no_entry:| :x:| :white_check_mark:| :white_check_mark:|
18+
| Debian 8.x | :no_entry: | :no_entry:| :white_check_mark:| :white_check_mark:| :white_check_mark:|
19+
| Debian 9.x | :no_entry: | :no_entry:| :x:| :white_check_mark:| :white_check_mark:|
20+
| RHEL 6.x | :no_entry: | :no_entry: | :white_check_mark: | :white_check_mark:| :white_check_mark:|
21+
| RHEL 7.x | :no_entry: | :no_entry: | :white_check_mark: | :white_check_mark:| :white_check_mark:|
2222

2323
- :white_check_mark: - fully tested, should works fine
2424
- :interrobang: - maybe works, not tested
@@ -34,7 +34,7 @@ MongoDB support matrix:
3434
mongodb_package: mongodb-org
3535

3636
# You can control installed version via this param.
37-
# Should be '3.2', '3.4', '3.6'. This role doesn't support MongoDB < 3.2.
37+
# Should be '3.4', '3.6' or '4.0'. This role doesn't support MongoDB < 3.4.
3838
# I will recommend you to use latest version of MongoDB.
3939
mongodb_version: "3.6"
4040

defaults/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ mongodb_package: mongodb-org
44
mongodb_version: "3.6"
55
mongodb_apt_keyserver: keyserver.ubuntu.com
66
mongodb_apt_key_id:
7-
"3.2": "EA312927"
87
"3.4": "0C49F3730359A14518585931BC711F9BA15703C6"
98
"3.6": "2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5"
9+
"4.0": "9DA31620334BD75D9DCB49F368818C72E52529D4"
1010

1111
mongodb_pymongo_from_pip: true # Install latest PyMongo via PIP or package manager
12-
mongodb_pymongo_pip_version: 3.6.1
12+
mongodb_pymongo_pip_version: 3.7.1
1313

1414
mongodb_user_update_password: "on_create" # MongoDB user password update default policy
1515
mongodb_manage_service: true

tasks/install.debian.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,22 @@
2525

2626
- name: Fail when used wrong mongodb_version variable with Debian Stretch
2727
fail:
28-
msg: "mongodb_version variable should be '3.2' or '3.6' for Debian Stretch"
28+
msg: "mongodb_version variable should be '3.6' or '4.0' for Debian Stretch"
2929
when: (mongodb_package == 'mongodb-org' and
3030
(mongodb_version is not defined
3131
or mongodb_repository[mongodb_major_version] is not defined
32-
or mongodb_version != '3.6') and ansible_distribution_release == 'stretch')
32+
or (mongodb_version != '3.6' and mongodb_version != '4.0'))
33+
and (ansible_distribution_release == 'stretch' and ansible_distribution_release == 'jessie'))
3334

3435
- name: Fail when used wrong mongodb_version variable with Ubuntu 18.04
3536
fail:
36-
msg: "mongodb_version variable should be '3.6' and mongodb_package should be 'mongodb' for Ubuntu 18.04"
37-
when: ((mongodb_package == 'mongodb-org' or mongodb_version != '3.6')
38-
and ansible_distribution_release == "bionic")
37+
msg: "mongodb_version variable should be '3.6' or '4.0' and mongodb_package should be 'mongodb' for Ubuntu 18.04"
38+
when: ((mongodb_package == 'mongodb-org' or (mongodb_version != '3.6' and mongodb_version != '4.0'))
39+
and ansible_distribution_release == "bionic")
3940

4041
- name: Fail when used wrong mongodb_version variable
4142
fail:
42-
msg: "mongodb_version variable should be '3.2', '3.4' or '3.6'"
43+
msg: "mongodb_version variable should be '3.4', '3.6' or '4.0'"
4344
when: (mongodb_package == 'mongodb-org' and
4445
(mongodb_version is not defined
4546
or mongodb_repository[mongodb_major_version] is not defined))

tests/host_vars/mongo3.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
mongodb_net_port: 30000
3-
mongodb_storage_journal_enabled: false
3+
mongodb_storage_journal_enabled: "{{ mongodb_major_version | version_compare('4.0', '>=') }}"
44
mongodb_storage_smallfiles: true
55
mongodb_storage_prealloc: false
66
mongodb_replication_params:

vars/Debian.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
22
mongodb_repository:
3-
"3.2": "deb http://repo.mongodb.org/apt/debian {{ ansible_distribution_release }}/mongodb-org/3.2 main"
43
"3.4": "deb http://repo.mongodb.org/apt/debian {{ ansible_distribution_release }}/mongodb-org/3.4 main"
54
"3.6": "deb http://repo.mongodb.org/apt/debian {{ ansible_distribution_release }}/mongodb-org/3.6 main"
5+
"4.0": "deb http://repo.mongodb.org/apt/debian {{ ansible_distribution_release }}/mongodb-org/4.0 main"

vars/RedHat.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
22

33
mongodb_repository:
4-
"3.2": "https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.2/$basearch/"
54
"3.4": "https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.4/$basearch/"
65
"3.6": "https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.6/$basearch/"
6+
"4.0": "https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.0/$basearch/"
77

88
mongodb_repository_gpgkey:
9-
"3.2": "https://www.mongodb.org/static/pgp/server-3.2.asc"
109
"3.4": "https://www.mongodb.org/static/pgp/server-3.4.asc"
1110
"3.6": "https://www.mongodb.org/static/pgp/server-3.6.asc"
11+
"4.0": "https://www.mongodb.org/static/pgp/server-4.0.asc"
1212

1313
mongodb_pidfile_path: "{{ '/var/run/mongodb/mongod.pid' if ('mongodb-org' in mongodb_package) else '' }}"

vars/Ubuntu.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
22
mongodb_repository:
3-
"3.2": "deb http://repo.mongodb.org/apt/ubuntu {{ ansible_distribution_release }}/mongodb-org/3.2 multiverse"
43
"3.4": "deb http://repo.mongodb.org/apt/ubuntu {{ ansible_distribution_release }}/mongodb-org/3.4 multiverse"
54
"3.6": "deb http://repo.mongodb.org/apt/ubuntu {{ ansible_distribution_release }}/mongodb-org/3.6 multiverse"
5+
"4.0": "deb http://repo.mongodb.org/apt/ubuntu {{ ansible_distribution_release }}/mongodb-org/4.0 multiverse"

0 commit comments

Comments
 (0)