Dropped support of EOL versions of MongoDB.

Added testing with Python 2.7.x
This commit is contained in:
Sergei Antipov 2018-02-16 11:53:36 +07:00
parent 392b053ad5
commit 7779fcf671
7 changed files with 20 additions and 19 deletions

View File

@ -5,6 +5,7 @@ dist: trusty
sudo: required
language: python
python:
- "2.7"
- "3.6"
env:
- >

View File

@ -14,8 +14,8 @@ MongoDB support matrix:
| ------------ |:-----------:|:-----------:|:-----------:|:-----------:|:-----------:|
| Ubuntu 14.04 | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark:| :x:|
| Ubuntu 16.04 | :no_entry: | :x: | :x: | :x:| :x:|
| Debian 7.x | :no_entry: | :interrobang: | :interrobang: | :interrobang:| :x:|
| Debian 8.x | :no_entry: | :x: | :x: | :x:| :x:|
| Debian 9.x | :no_entry: | :x: | :x: | :x:| :x:|
| RHEL 6.x | :no_entry: | :interrobang: | :interrobang: | :interrobang: | :interrobang: |
| RHEL 7.x | :no_entry: | :interrobang: | :interrobang: | :interrobang: | :interrobang: |

View File

@ -1,13 +1,12 @@
---
mongodb_package: mongodb-org
mongodb_version: "3.4"
mongodb_version: "3.6"
mongodb_apt_keyserver: keyserver.ubuntu.com
mongodb_apt_key_id:
"2.6": "7F0CEB10"
"3.0": "7F0CEB10"
"3.2": "EA312927"
"3.4": "0C49F3730359A14518585931BC711F9BA15703C6"
"3.6": "2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5"
mongodb_pymongo_from_pip: true # Install latest PyMongo via PIP or package manager
@ -41,7 +40,7 @@ mongodb_security_keyfile: /etc/mongodb-keyfile # Specify path to keyfile with
mongodb_storage_dbpath: /data/db # Directory for datafiles
# The storage engine for the mongod database. Available values:
# 'mmapv1', 'wiredTiger'
mongodb_storage_engine: "{{ 'mmapv1' if mongodb_version[0:3] == '3.0' else 'wiredTiger' }}"
mongodb_storage_engine: "wiredTiger"
# mmapv1 specific options
mongodb_storage_quota_enforced: false # Limits each database to a certain number of files
mongodb_storage_quota_maxfiles: 8 # Number of quota files per DB
@ -95,8 +94,8 @@ mongodb_user_admin_password: passw0rd
mongodb_root_admin_name: siteRootAdmin
mongodb_root_admin_password: passw0rd
mongodb_root_backup_name: "backupuser"
mongodb_root_backup_password: "passw0rd"
mongodb_root_backup_name: backupuser
mongodb_root_backup_password: passw0rd
# setParameter config
mongodb_set_parameters:

View File

@ -23,7 +23,7 @@ module: mongodb_replication
short_description: Adds or removes a node from a MongoDB Replica Set.
description:
- Adds or removes host from a MongoDB replica set. Initialize replica set if it needed.
version_added: "2.2"
version_added: "2.4"
options:
login_user:
description:
@ -105,7 +105,7 @@ options:
default: present
choices: [ "present", "absent" ]
notes:
- Requires the pymongo Python package on the remote host, version 3.0+. It
- Requires the pymongo Python package on the remote host, version 3.2+. It
can be installed using pip or the OS package manager. @see http://api.mongodb.org/python/current/installation.html
requirements: [ "pymongo" ]
author: "Sergei Antipov @UnderGreen"
@ -166,11 +166,14 @@ else:
# MongoDB module specific support methods.
#
def check_compatibility(module, client):
if LooseVersion(PyMongoVersion) <= LooseVersion('3.0'):
module.fail_json(msg='Note: you must use pymongo 3.0+')
srv_info = client.server_info()
if LooseVersion(srv_info['version']) >= LooseVersion('3.2') and LooseVersion(PyMongoVersion) <= LooseVersion('3.2'):
module.fail_json(msg=' (Note: you must use pymongo 3.2+ with MongoDB >= 3.2)')
if LooseVersion(PyMongoVersion) <= LooseVersion('3.2'):
module.fail_json(msg='Note: you must use pymongo 3.2+')
if LooseVersion(srv_info['version']) >= LooseVersion('3.4') and LooseVersion(PyMongoVersion) <= LooseVersion('3.4'):
module.fail_json(msg='Note: you must use pymongo 3.4+ with MongoDB 3.4.x')
if LooseVersion(srv_info['version']) >= LooseVersion('3.6') and LooseVersion(PyMongoVersion) <= LooseVersion('3.6'):
module.fail_json(msg='Note: you must use pymongo 3.6+ with MongoDB 3.6.x')
def check_members(state, module, client, host_name, host_port, host_type):
admin_db = client['admin']

View File

@ -1,6 +1,5 @@
---
mongodb_repository:
"2.6": "deb http://downloads-distro.mongodb.org/repo/debian-sysvinit dist 10gen"
"3.0": "deb http://repo.mongodb.org/apt/debian wheezy/mongodb-org/3.0 main"
"3.2": "deb http://repo.mongodb.org/apt/debian {{ ansible_distribution_release }}/mongodb-org/3.2 main"
"3.4": "deb http://repo.mongodb.org/apt/debian {{ ansible_distribution_release }}/mongodb-org/3.4 main"
"3.6": "deb http://repo.mongodb.org/apt/debian {{ ansible_distribution_release }}/mongodb-org/3.6 main"

View File

@ -1,13 +1,13 @@
---
mongodb_repository:
"2.6": "http://downloads-distro.mongodb.org/repo/redhat/os/$basearch/"
"3.0": "https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.0/$basearch/"
"3.2": "https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.2/$basearch/"
"3.4": "https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.4/$basearch/"
"3.6": "https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.6/$basearch/"
mongodb_repository_gpgkey:
"3.2": "https://www.mongodb.org/static/pgp/server-3.2.asc"
"3.4": "https://www.mongodb.org/static/pgp/server-3.4.asc"
"3.6": "https://www.mongodb.org/static/pgp/server-3.6.asc"
mongodb_pidfile_path: "{{ '/var/run/mongodb/mongod.pid' if ('mongodb-org' in mongodb_package) else '' }}"

View File

@ -1,6 +1,5 @@
---
mongodb_repository:
"2.6": "deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen"
"3.0": "deb http://repo.mongodb.org/apt/ubuntu {{ ansible_distribution_release }}/mongodb-org/3.0 multiverse"
"3.2": "deb http://repo.mongodb.org/apt/ubuntu {{ ansible_distribution_release }}/mongodb-org/3.2 multiverse"
"3.4": "deb http://repo.mongodb.org/apt/ubuntu {{ ansible_distribution_release }}/mongodb-org/3.4 multiverse"
"3.6": "deb http://repo.mongodb.org/apt/ubuntu {{ ansible_distribution_release }}/mongodb-org/3.6 multiverse"