From ffadd43847e32e9be653bee6b21d4ac6915e1290 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yann=20F=C3=B6lling?= Date: Wed, 29 Jun 2022 13:32:57 +0200 Subject: [PATCH] Enable MongoDB 5.0 support and set as default --- .github/workflows/amazonlinux2.yml | 1 + .github/workflows/centos.yml | 3 ++- .github/workflows/debian.yml | 1 + .github/workflows/ubuntu.yml | 2 ++ README.md | 22 +++++++++++----------- defaults/main.yml | 5 ++++- molecule/cluster/molecule.yml | 2 +- molecule/default/molecule.yml | 2 +- vars/Amazon.yml | 14 ++++++++------ vars/Debian.yml | 1 + vars/RedHat.yml | 2 ++ vars/Ubuntu.yml | 1 + 12 files changed, 35 insertions(+), 21 deletions(-) diff --git a/.github/workflows/amazonlinux2.yml b/.github/workflows/amazonlinux2.yml index ded9f530..b79ed266 100644 --- a/.github/workflows/amazonlinux2.yml +++ b/.github/workflows/amazonlinux2.yml @@ -16,6 +16,7 @@ jobs: molecule_distro: - amazonlinux2 mongodb_version: + - '5.0' - '4.4' - '4.2' - '4.0' diff --git a/.github/workflows/centos.yml b/.github/workflows/centos.yml index 90b08b43..812b20b6 100644 --- a/.github/workflows/centos.yml +++ b/.github/workflows/centos.yml @@ -13,10 +13,11 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - molecule_distro: + molecule_distro: - centos7 - centos8 mongodb_version: + - '5.0' - '4.4' - '4.2' - '4.0' diff --git a/.github/workflows/debian.yml b/.github/workflows/debian.yml index a49d1a56..a755f446 100644 --- a/.github/workflows/debian.yml +++ b/.github/workflows/debian.yml @@ -17,6 +17,7 @@ jobs: - debian9 - debian10 mongodb_version: + - '5.0' - '4.4' - '4.2' - '4.0' diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index eb21daae..ae2f4d38 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -23,6 +23,8 @@ jobs: include: - molecule_distro: ubuntu2004 mongodb_version: '4.4' + - molecule_distro: ubuntu2004 + mongodb_version: '5.0' env: MONGODB_VERSION: ${{ matrix.mongodb_version }} MOLECULE_DISTRO: ${{ matrix.molecule_distro }} diff --git a/README.md b/README.md index ee0313fe..c4884df6 100644 --- a/README.md +++ b/README.md @@ -11,16 +11,16 @@ Ansible role to install and manage [MongoDB](http://www.mongodb.org/). MongoDB support matrix: -| Distribution | < MongoDB 3.4 | MongoDB 3.6 | MongoDB 4.0 | MongoDB 4.2 | MongoDB 4.4 | -| -------------- | :-----------: | :----------------: | :----------------: | :----------------: | :----------------: | -| Ubuntu 16.04 | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | -| Ubuntu 18.04 | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | -| Ubuntu 20.04 | :no_entry: | :x: | :x: | :x: | :white_check_mark: | -| Debian 9.x | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | -| Debian 10.x | :no_entry: | :x: | :x: | :white_check_mark: | :white_check_mark: | -| RHEL 7.x | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | -| RHEL 8.x | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | -| Amazon Linux 2 | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| Distribution | < MongoDB 3.4 | MongoDB 3.6 | MongoDB 4.0 | MongoDB 4.2 | MongoDB 4.4 | MongoDB 5.0 | +| -------------- | :-----------: | :----------------: | :----------------: | :----------------: | :----------------: | :----------------: | +| Ubuntu 16.04 | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | :x: | +| Ubuntu 18.04 | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | :x: | +| Ubuntu 20.04 | :no_entry: | :x: | :x: | :x: | :white_check_mark: | :white_check_mark: | +| Debian 9.x | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| Debian 10.x | :no_entry: | :x: | :x: | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| RHEL 7.x | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| RHEL 8.x | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| Amazon Linux 2 | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | - :white_check_mark: - fully tested - :x: - don't have official support @@ -38,7 +38,7 @@ mongodb_package: mongodb-org # `mongodb_version` variable sets version of MongoDB. # Should be '3.6', '4.0', '4.2' or '4.4'. This role doesn't support MongoDB < 3.6. # I would recommend you to use the latest version of MongoDB. -mongodb_version: "4.4" +mongodb_version: "5.0" mongodb_pymongo_from_pip: true # Install latest PyMongo via PIP or package manager mongodb_pymongo_pip_version: 3.6.1 # Choose PyMong version to install from pip. If not set use latest diff --git a/defaults/main.yml b/defaults/main.yml index d73a8ade..07a6cf8f 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -2,7 +2,7 @@ mongodb_package: mongodb-org mongodb_package_state: present -mongodb_version: "4.4" +mongodb_version: "5.0" mongodb_apt_key_from_url: false mongodb_apt_keyserver: 'hkp://keyserver.ubuntu.com:80' mongodb_apt_key_id: @@ -10,11 +10,14 @@ mongodb_apt_key_id: "4.0": "9DA31620334BD75D9DCB49F368818C72E52529D4" "4.2": "E162F504A20CDF15827F718D4B7C549A058F8B6B" "4.4": "20691eec35216c63caf66ce1656408e390cfb1f5" + "5.0": "F5679A222C647C87527C2F8CB00A0BD1E2C63C11" + mongodb_apt_key_url: "3.6": "https://www.mongodb.org/static/pgp/server-3.6.asc" "4.0": "https://www.mongodb.org/static/pgp/server-4.0.asc" "4.2": "https://www.mongodb.org/static/pgp/server-4.2.asc" "4.4": "https://www.mongodb.org/static/pgp/server-4.4.asc" + "5.0": "https://www.mongodb.org/static/pgp/server-5.0.asc" mongodb_pymongo_from_pip: true # Install latest PyMongo via PIP or package manager mongodb_pymongo_pip_version: 3.11.3 diff --git a/molecule/cluster/molecule.yml b/molecule/cluster/molecule.yml index e8f41b3b..bc21c384 100644 --- a/molecule/cluster/molecule.yml +++ b/molecule/cluster/molecule.yml @@ -46,7 +46,7 @@ provisioner: converge: ${MOLECULE_PLAYBOOK:-../default/converge.yml} prepare: ${MOLECULE_PLAYBOOK:-../default/prepare.yml} env: - MONGODB_VERSION: ${MONGODB_VERSION:-4.4} + MONGODB_VERSION: ${MONGODB_VERSION:-5.0} MONGODB_PACKAGE: ${MONGODB_PACKAGE:-mongodb-org} AUTH_STATE: ${AUTH_STATE:-disabled} REPLICASET: ${REPLICASET:-testrs} diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index 6365d0f2..1eb01e35 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -28,7 +28,7 @@ provisioner: converge: ${MOLECULE_PLAYBOOK:-converge.yml} prepare: ${MOLECULE_PLAYBOOK:-prepare.yml} env: - MONGODB_VERSION: ${MONGODB_VERSION:-4.4} + MONGODB_VERSION: ${MONGODB_VERSION:-5.0} MONGODB_PACKAGE: ${MONGODB_PACKAGE:-mongodb-org} AUTH_STATE: ${AUTH_STATE:-disabled} inventory: diff --git a/vars/Amazon.yml b/vars/Amazon.yml index 9bb80478..afd7b7dc 100644 --- a/vars/Amazon.yml +++ b/vars/Amazon.yml @@ -1,15 +1,17 @@ --- mongodb_repository: - "4.4": "https://repo.mongodb.org/yum/amazon/2/mongodb-org/4.4/x86_64/" - "4.2": "https://repo.mongodb.org/yum/amazon/2/mongodb-org/4.2/x86_64/" - "4.0": "https://repo.mongodb.org/yum/amazon/2/mongodb-org/4.0/x86_64/" "3.6": "https://repo.mongodb.org/yum/amazon/2013.03/mongodb-org/3.6/x86_64/" + "4.0": "https://repo.mongodb.org/yum/amazon/2/mongodb-org/4.0/x86_64/" + "4.2": "https://repo.mongodb.org/yum/amazon/2/mongodb-org/4.2/x86_64/" + "4.4": "https://repo.mongodb.org/yum/amazon/2/mongodb-org/4.4/x86_64/" + "5.0": "https://repo.mongodb.org/yum/amazon/2/mongodb-org/5.0/x86_64/" mongodb_repository_gpgkey: - "4.4": "https://www.mongodb.org/static/pgp/server-4.4.asc" - "4.2": "https://www.mongodb.org/static/pgp/server-4.2.asc" - "4.0": "https://www.mongodb.org/static/pgp/server-4.0.asc" "3.6": "https://www.mongodb.org/static/pgp/server-3.6.asc" + "4.0": "https://www.mongodb.org/static/pgp/server-4.0.asc" + "4.2": "https://www.mongodb.org/static/pgp/server-4.2.asc" + "4.4": "https://www.mongodb.org/static/pgp/server-4.4.asc" + "5.0": "https://www.mongodb.org/static/pgp/server-5.0.asc" mongodb_pidfile_path: "{{ '/var/run/mongodb/mongod.pid' if ('mongodb-org' in mongodb_package) else '' }}" diff --git a/vars/Debian.yml b/vars/Debian.yml index 8871afc8..95638b1a 100644 --- a/vars/Debian.yml +++ b/vars/Debian.yml @@ -4,6 +4,7 @@ mongodb_repository: "4.0": "deb http://repo.mongodb.org/apt/debian {{ ansible_distribution_release }}/mongodb-org/4.0 main" "4.2": "deb http://repo.mongodb.org/apt/debian {{ ansible_distribution_release }}/mongodb-org/4.2 main" "4.4": "deb http://repo.mongodb.org/apt/debian {{ ansible_distribution_release }}/mongodb-org/4.4 main" + "5.0": "deb http://repo.mongodb.org/apt/debian {{ ansible_distribution_release }}/mongodb-org/5.0 main" mongodb_pymongo_package: "{{ 'python3-pymongo' if ansible_facts['python'].version.major == 3 else 'python-pymongo' }}" mongodb_pymongo_deps: diff --git a/vars/RedHat.yml b/vars/RedHat.yml index 34792f99..a765a00c 100644 --- a/vars/RedHat.yml +++ b/vars/RedHat.yml @@ -4,12 +4,14 @@ mongodb_repository: "4.0": "https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.0/$basearch/" "4.2": "https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.2/$basearch/" "4.4": "https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.4/$basearch/" + "5.0": "https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/5.0/$basearch/" mongodb_repository_gpgkey: "3.6": "https://www.mongodb.org/static/pgp/server-3.6.asc" "4.0": "https://www.mongodb.org/static/pgp/server-4.0.asc" "4.2": "https://www.mongodb.org/static/pgp/server-4.2.asc" "4.4": "https://www.mongodb.org/static/pgp/server-4.4.asc" + "5.0": "https://www.mongodb.org/static/pgp/server-5.0.asc" mongodb_pidfile_path: "{{ '/var/run/mongodb/mongod.pid' if ('mongodb-org' in mongodb_package) else '' }}" diff --git a/vars/Ubuntu.yml b/vars/Ubuntu.yml index 5fd8dd19..0c12b03b 100644 --- a/vars/Ubuntu.yml +++ b/vars/Ubuntu.yml @@ -4,6 +4,7 @@ mongodb_repository: "4.0": "deb http://repo.mongodb.org/apt/ubuntu {{ ansible_distribution_release }}/mongodb-org/4.0 multiverse" "4.2": "deb http://repo.mongodb.org/apt/ubuntu {{ ansible_distribution_release }}/mongodb-org/4.2 multiverse" "4.4": "deb http://repo.mongodb.org/apt/ubuntu {{ ansible_distribution_release }}/mongodb-org/4.4 multiverse" + "5.0": "deb http://repo.mongodb.org/apt/ubuntu {{ ansible_distribution_release }}/mongodb-org/5.0 multiverse" mongodb_pymongo_package: "{{ 'python3-pymongo' if ansible_facts['python'].version.major == 3 else 'python-pymongo' }}" mongodb_pymongo_deps: