From bd4256da886790c6a34240d7867fc919089df481 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Duchaussois?= Date: Wed, 27 Jun 2018 11:57:28 +0200 Subject: [PATCH 1/2] Allow user to choose PyMongo version when using pip --- README.md | 1 + tasks/install.debian.yml | 5 ++++- tasks/install.redhat.yml | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f38f89f..89b605c 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,7 @@ mongodb_package: mongodb-org mongodb_version: "3.6" mongodb_pymongo_from_pip: true # Install latest PyMongo via PIP or package manager +mongodb_pymongo_pip_version: # Choose PyMong version to install from pip. If not set use latest mongodb_user_update_password: "on_create" # MongoDB user password update default policy mongodb_manage_service: true diff --git a/tasks/install.debian.yml b/tasks/install.debian.yml index 5423040..550194e 100644 --- a/tasks/install.debian.yml +++ b/tasks/install.debian.yml @@ -68,5 +68,8 @@ when: mongodb_pymongo_from_pip - name: Install PyMongo from PIP - pip: name=pymongo state=latest + pip: + name: pymongo + state: "{{ mongodb_pymongo_pip_version is defined | ternary('present', 'latest') }}" + version: "{{ mongodb_pymongo_pip_version | default(omit) }}" when: mongodb_pymongo_from_pip diff --git a/tasks/install.redhat.yml b/tasks/install.redhat.yml index 668a0de..8c596dd 100644 --- a/tasks/install.redhat.yml +++ b/tasks/install.redhat.yml @@ -42,5 +42,6 @@ - name: Install PyMongo from PIP pip: name: pymongo - state: latest + state: "{{ mongodb_pymongo_pip_version is defined | ternary('present', 'latest') }}" + version: "{{ mongodb_pymongo_pip_version | default(omit) }}" when: mongodb_pymongo_from_pip From fa0ca7cdeaf11f50976377077875254c5f620c96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Duchaussois?= Date: Wed, 27 Jun 2018 14:02:17 +0200 Subject: [PATCH 2/2] Add safe version to default pymongo version --- README.md | 2 +- defaults/main.yml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 89b605c..4853fd6 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ mongodb_package: mongodb-org mongodb_version: "3.6" mongodb_pymongo_from_pip: true # Install latest PyMongo via PIP or package manager -mongodb_pymongo_pip_version: # Choose PyMong version to install from pip. If not set use latest +mongodb_pymongo_pip_version: 3.6.1 # Choose PyMong version to install from pip. If not set use latest mongodb_user_update_password: "on_create" # MongoDB user password update default policy mongodb_manage_service: true diff --git a/defaults/main.yml b/defaults/main.yml index 8bf0092..71c4f1b 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -9,6 +9,7 @@ mongodb_apt_key_id: "3.6": "2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5" mongodb_pymongo_from_pip: true # Install latest PyMongo via PIP or package manager +mongodb_pymongo_pip_version: 3.6.1 mongodb_user_update_password: "on_create" # MongoDB user password update default policy mongodb_manage_service: true