Skip to content

Commit

Permalink
Update to RocketChaat 7.1 and MongoDB 7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandermeindl committed Dec 17, 2024
1 parent 7d1c515 commit b1e4b78
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 12 deletions.
1 change: 0 additions & 1 deletion roles/mongodb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ mongodb_storage_quota_enforced: false # Limits each database to a certain number
mongodb_storage_quota_maxfiles: 8 # Number of quota files per DB
mongodb_storage_smallfiles: false # Very useful for non-data nodes

mongodb_storage_journal_enabled: true # Enable journaling
mongodb_storage_prealloc: true # Disable data file preallocation

# WiredTiger Options
Expand Down
17 changes: 14 additions & 3 deletions roles/mongodb/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
---

mongodb_package: mongodb-org
mongodb_version: '5.0'

# Update to from 5 to 6
# 1. Enable the repository for MongoDB-6.0.
# 2. To ensure 'featureCompatibilityVersion' is set to "5.0":
# db.adminCommand({getParameter: 1, featureCompatibilityVersion: 1})
# To update 'featureCompatibilityVersion':
# db.adminCommand({setFeatureCompatibilityVersion: "5.0"})
# 3. To shut down MongoDB: rs.stepDown()
# 4. Stop the service: systemctl stop mongod
# 5. Update MongoDB: apt upgrade* Ensure the following packages are in the updating list:
# mongodb-org mongodb-org-mongos mongodb-org-server mongodb-org-shell mongodb-org-tools
# 6. Start MongoDB: systemctl start mongod

mongodb_version: '7.0'

mongodb_apt_url: http://repo.mongodb.org/apt/{{ ansible_distribution | lower }}
mongodb_apt_suites: "{{ ansible_distribution_release }}/mongodb-org/{{ mongodb_version }}"
Expand Down Expand Up @@ -72,8 +85,6 @@ mongodb_storage_engine: "wiredTiger"
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
mongodb_storage_smallfiles: false # Very useful for non-data nodes

mongodb_storage_journal_enabled: true # Enable journaling
mongodb_storage_prealloc: true # Enable data file preallocation

mongodb_wiredtiger_directory_for_indexes: false
Expand Down
4 changes: 2 additions & 2 deletions roles/mongodb/tasks/setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@

- name: Check whether admin user is already exist
ansible.builtin.command: >
mongo --quiet {{ '--ssl --host ' + mongodb_net_ssl_host if mongodb_net_ssl_mode == 'requireSSL' else '' }} -u {{ mongodb_user_admin_name }} \
-p {{ mongodb_user_admin_password }} --port {{ mongodb_net_port }} --eval 'db.version()' admin
mongosh --quiet {{ '--ssl --host ' + mongodb_net_ssl_host if mongodb_net_ssl_mode == 'requireSSL' else '' }} -u {{ mongodb_user_admin_name }} \
-p {{ mongodb_user_admin_password }} --port {{ mongodb_net_port }} --eval 'db.version()' admin
register: mongodb_user_admin_check
changed_when: false
check_mode: false
Expand Down
2 changes: 0 additions & 2 deletions roles/mongodb/templates/mongod.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ storage:
dbPath: {{ mongodb_storage_dbpath }}
directoryPerDB: {{ mongodb_storage_dirperdb | to_nice_json }}
engine: {{ mongodb_storage_engine }}
journal:
enabled: {{ mongodb_storage_journal_enabled | to_nice_json }}
{% if mongodb_storage_engine == 'mmapv1' -%}
mmapv1:
quota:
Expand Down
2 changes: 0 additions & 2 deletions roles/mongodb/templates/mongod_init.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ storage:
dbPath: {{ mongodb_storage_dbpath }}
directoryPerDB: {{ mongodb_storage_dirperdb | to_nice_json }}
engine: {{ mongodb_storage_engine }}
journal:
enabled: {{ mongodb_storage_journal_enabled | to_nice_json }}
{% if mongodb_storage_engine == 'mmapv1' -%}
mmapv1:
quota:
Expand Down
3 changes: 2 additions & 1 deletion roles/rocketchat/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ rocketchat_packages:
rocketchat_dir: /srv/rocketchat
rocketchat_application_path: '{{ rocketchat_dir }}/bundle'
# "latest" implies latest stable here, can be "3.3.0", for example
rocketchat_version: 6.13.1
rocketchat_version: 7.1.0
# rocketchat_tarball_remote: https://releases.rocket.chat/{{ rocketchat_version }}/download
rocketchat_tarball_remote: https://cdn-download.rocket.chat/build/rocket.chat-{{ rocketchat_version }}.tgz
rocketchat_tarball_fetch_timeout: 100
Expand All @@ -21,6 +21,7 @@ rocketchat_service_environment: []
# MongoDB settings
# mongodb can be disabled for bulleyes update
rocketchat_with_mongodb: true
rocketchat_with_init_mongodb_replica: true
rocketchat_mongodb_server: 127.0.0.1
rocketchat_mongodb_port: 27017
rocketchat_mongodb_database: rocketchat
Expand Down
3 changes: 2 additions & 1 deletion roles/rocketchat/tasks/mongodb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@

- name: Ensure the MongoDB replSets have been initiated
ansible.builtin.shell: >-
mongo --quiet --eval
mongosh --quiet --eval
'JSON.stringify(rs.initiate({_id:"{{ mongodb_replication_replset }}",
members: [{"_id":1, "host":
"{{ rocketchat_mongodb_server }}:{{ rocketchat_mongodb_port }}"}]}))'
become: true
become_user: "{{ mongodb_user | default('mongodb') }}"
when: rocketchat_with_init_mongodb_replica
args:
executable: /bin/bash
register: repl_result
Expand Down

0 comments on commit b1e4b78

Please sign in to comment.