set feature compatability version if we are upgarding mongodb

This commit is contained in:
BSounder 2022-07-07 22:06:42 -07:00
parent 73e4ce1dae
commit 075a62e3eb
2 changed files with 23 additions and 0 deletions

View File

@ -8,5 +8,8 @@ rc_version: 4.8.1
# WIP to get to 5.0
mongo_version: 4.4
# WIP to get to 5.0 - if same as mongo_version or false, feature compatibility version will not be set
prev_mongo_version: 4.2
# backup by default - saves to /home/{{ main_user }}/rocketchat/data/dump/2015-07-09T16:59:26Z" (iso8601 of current date)
backup_db: true

View File

@ -122,9 +122,22 @@
dest: "{{ local_backup_dir }}"
tags: mongodump
- name: Set feature compability version if we are upgrading mongoDB
when: prev_mongo_version and prev_mongo_version != mongo_version
community.docker.docker_container_exec:
container: rocketchat_mongo_1
command: >
bash -c 'mongo --eval "db.adminCommand( { setFeatureCompatibilityVersion: \"{{ prev_mongo_version }}\" } )"'
# chdir: /home/{{ main_user }}/rocketchat
# chdir: /
#docker-compose exec mongo
register: __set_feature_compability_version_mongo
tags: mongoupgrade
- name: debug docker compose down
debug:
var: __remove_rocketchat
tags: bring-down
- name: debug docker compose up debug
debug:
@ -135,3 +148,10 @@
debug:
var: __backup_result
tags: mongodump
- name: debug mongo upgrade set feature compatability version
when: prev_mongo_version and prev_mongo_version != mongo_version
debug:
var: __set_feature_compability_version_mongo
tags: mongoupgrade