Skip to content

Commit

Permalink
Simplify so default is always 4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
amanda11 committed Jun 29, 2020
1 parent 4329b00 commit 94e3c4f
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 22 deletions.
6 changes: 2 additions & 4 deletions roles/StackStorm.mongodb/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
---
# MongoDB default versions, used if mongo_version is not set
mongodb34_version: "3.4"
mongodb36_version: "3.6"
mongodb40_version: "4.0"
# MongoDB default version
mongodb_version: "4.0"
10 changes: 5 additions & 5 deletions roles/StackStorm.mongodb/tasks/mongodb_debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
name:
# re-installing different version of 'mongodb-org' meta package doesn't automatically
# upgrade or downgrade its dependencies. So we need to explicitly list them one-by-one.
- mongodb-org={{ mongodb_use_version }}*
- mongodb-org-shell={{ mongodb_use_version }}*
- mongodb-org-server={{ mongodb_use_version }}*
- mongodb-org-mongos={{ mongodb_use_version }}*
- mongodb-org-tools={{ mongodb_use_version }}*
- mongodb-org={{ mongodb_version }}*
- mongodb-org-shell={{ mongodb_version }}*
- mongodb-org-server={{ mongodb_version }}*
- mongodb-org-mongos={{ mongodb_version }}*
- mongodb-org-tools={{ mongodb_version }}*
state: present
register: _task
retries: 5
Expand Down
2 changes: 1 addition & 1 deletion roles/StackStorm.mongodb/tasks/mongodb_redhat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
- name: yum | Install mongodb
become: yes
yum:
name: mongodb-org-{{ mongodb_use_version }}*
name: mongodb-org-{{ mongodb_version }}*
state: present
# TODO: Allow yum downgrade since Ansible 2.4
# https://github.com/ansible/ansible/pull/21516
Expand Down
4 changes: 1 addition & 3 deletions roles/StackStorm.mongodb/vars/debian.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Set mongodb version to provided value or 3.6 if not specified
mongodb_use_version: "{{ mongodb_version | default (mongodb40_version) }}"
# Extract mongodb "major.minor" version
mongodb_major_minor_version: "{{ (mongodb_use_version|string)[:3] }}"
mongodb_major_minor_version: "{{ (mongodb_version|string)[:3] }}"
# Use the following URL to find the key: https://www.mongodb.org/static/pgp/server-{{ mongodb_major_minor_version }}.asc
mongodb_apt_keys:
"3.2": "42F3E95A2C4F08279C4960ADD68FA50FEA312927"
Expand Down
4 changes: 1 addition & 3 deletions roles/StackStorm.mongodb/vars/redhat_6.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,5 @@ mongo_dependencies:
- pyOpenSSL
- python-pyasn1
- python-ndg_httpsclient
# Set mongodb version to provided value or 3.4 if not specified
mongodb_use_version: "{{ mongodb_version | default (mongodb34_version) }}"
# Extract mongodb "major.minor" version
mongodb_major_minor_version: "{{ (mongodb_use_version|string)[:3] }}"
mongodb_major_minor_version: "{{ (mongodb_version|string)[:3] }}"
4 changes: 1 addition & 3 deletions roles/StackStorm.mongodb/vars/redhat_7.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,5 @@ mongo_dependencies:
- pyOpenSSL
- python-pyasn1
- python-ndg_httpsclient
# Set mongodb version to provided value or 3.6 if not specified
mongodb_use_version: "{{ mongodb_version | default (mongodb40_version) }}"
# Extract mongodb "major.minor" version
mongodb_major_minor_version: "{{ (mongodb_use_version|string)[:3] }}"
mongodb_major_minor_version: "{{ (mongodb_version|string)[:3] }}"
4 changes: 1 addition & 3 deletions roles/StackStorm.mongodb/vars/redhat_8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,5 @@ mongo_dependencies:
- python3-urllib3
- python3-pyOpenSSL
- python3-pyasn1
# Set mongodb version to provided value or 4.0 if not specified
mongodb_use_version: "{{ mongodb_version | default (mongodb40_version) }}"
# Extract mongodb "major.minor" version
mongodb_major_minor_version: "{{ (mongodb_use_version|string)[:3] }}"
mongodb_major_minor_version: "{{ (mongodb_version|string)[:3] }}"

0 comments on commit 94e3c4f

Please sign in to comment.