ansible-collections / community.mongodb

MongoDB Ansible Collection
http://galaxy.ansible.com/community/mongodb
GNU General Public License v3.0
108 stars 72 forks source link

Preventing unintended upgrades on Ubuntu #364

Closed kkrasnov1 closed 3 years ago

kkrasnov1 commented 3 years ago
SUMMARY

According to the documentation https://docs.mongodb.com/v4.4/tutorial/install-mongodb-on-ubuntu/, it is recommended to hold package versions in order to unintentionally update MongoDB for specific version:

Optional. Although you can specify any available version of MongoDB, apt-get will upgrade the packages when a newer version becomes available. To prevent unintended upgrades, you can pin the package at the currently installed version:

echo "mongodb-org hold" \| sudo dpkg --set-selections
echo "mongodb-org-server hold" \| sudo dpkg --set-selections
echo "mongodb-org-shell hold" \| sudo dpkg --set-selections
echo "mongodb-org-mongos hold" \| sudo dpkg --set-selections
echo "mongodb-org-tools hold" \| sudo dpkg --set-selections

Please add the hold parameter for mongodb_install.

ISSUE TYPE
COMPONENT NAME

mongodb_install

ADDITIONAL INFORMATION
rhysmeister commented 3 years ago

I did this in https://github.com/rhysmeister/AutomatingMongoDBWithAnsible with yum-versionlock. Probably easy enough.

rhysmeister commented 3 years ago

Added in https://github.com/ansible-collections/community.mongodb/pull/370

Could do with user testing. Can be installed from https://github.com/ansible-collections/community.mongodb/releases/tag/latest

kkrasnov1 commented 3 years ago

I've tested it. It works correctly. Thank you. Have you considered doing this with ansible.builtin.dpkg_selections?

rhysmeister commented 3 years ago

There doesn't seem to be an equivalent for RedHat systems so I'd rather keep it in one place for now. Maybe in the future.

Cheers,

Rhys