Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating mongodb packages to latest version #676

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

panpomaly
Copy link
Contributor

SUMMARY

After having installed and configured mongodb for over a year with this collection, I wanted to upgrade to version 7.0.

There are several ways to achieve this in general, but I wanted to use the collection if possible. The only way i saw was specifying a specific_mongodb_version.

I added a variable mongod_package_state to be used as state for the package task (Ensure mongod package is installed). This only works for package manager allowing to set the state to latest (I use debian/ubuntu).

This works for me, but may not be the best solution. My problem with this solution is, that mongodb_install notifies a handler defined in mongodb_mongod, which works, but is not really good style. And when using Mongos, a restart of the daemon would also be necessary.

Maybe there is a better / easier way. I'm open to ideas

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

mongodb_install

ADDITIONAL INFORMATION

An upgrade playbook could be like this:

- hosts: mongodb
  serial: 1
  collections: community.mongodb
  vars:
    - mongod_package_state: latest
  pre_tasks:
    - name: remove old mongodb-mongosh package
      ansible.builtin.package:
        name: mongodb-mongosh
        state: absent
  roles:
    - role: mongodb_repository
      tags: ['mongodb_base']
    - role: mongodb_linux
      tags: ['mongodb_base']
    - role: mongodb_install
      tags: ['mongodb_base']
    - role: mongodb_mongod
      tags: ['mongodb']

Copy link

codecov bot commented Aug 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.40%. Comparing base (42d35bd) to head (fd526ad).
Report is 21 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #676      +/-   ##
==========================================
- Coverage   73.68%   73.40%   -0.29%     
==========================================
  Files           6        6              
  Lines         935      940       +5     
  Branches      144      145       +1     
==========================================
+ Hits          689      690       +1     
- Misses        210      211       +1     
- Partials       36       39       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rhysmeister
Copy link
Collaborator

rhysmeister commented Aug 16, 2024

Hello @panpomaly,

Cheers,

Rhys

@github-actions github-actions bot added Stale and removed Stale labels Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants