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

Fix ReplicaSet with Auth creation (new error message to handle) #632

Merged
merged 1 commit into from
May 9, 2022

Conversation

BDelacour
Copy link
Contributor

fix: replset with auth returns "requires authentication" message when checking replicaset members

Pull Request (PR) description

mongodb::globals::version: 4.4.10
mongodb::server::port: 27017
mongodb::server::bind_ip:
  - 0.0.0.0
mongodb::server::auth: true
mongodb::server::store_creds: true
mongodb::server::handle_creds: true
mongodb::server::create_admin: true
mongodb::server::admin_password: admin

mongodb::server::keyfile: /etc/mongodb.key
mongodb::server::key: |
  Z17Lor65VIgRCGClC3IZhXJe34fPM2Xa7lrzZdV35PDjP4cm6Vt7rP9jSQsxZBY2
  UXGOIFNzQ+IOsU/bP9EUmfXqFWEJcjdXw9AfaEU+630XwmYRFnzQ3AEwxLqAgSVN
  47DXoZNh7lFu7VJanhupzPwkgpsgqgpBC9HaJCDe0Pxx5AenrxWdSwRkmzrG5tEL
  JJXxdCWPGVCYp6YXzdTuHzJ2Ff/Ph2yhDxNlxNHFcgeuFGVnPe5TsjFEqzsYxjNI
  8q75LSwN+D9L9yPLAPwV3l70mKbKncp8RP/NlR3dScQpuS0P/PhkWkYs2hQVFAOu
  O52UOiwKti4Zaio3K2ZVIN2PlFQ8m2H5VMijkI6CQE5iGWieui/eJCtakauEuOXk
  NHHJ0DseSWNEapz5QE+lpWicDLb8maz9Gon3WEEDhcCt68MyA+/0HhoOgomhoEOj
  /R5Did6BvJpiYsVhbKakiFauDZlsXM710kSHtxs2IYXj+PBa7FMDr4rgLk4eqU5e
  ZY6LsFvVxgi+qNSsIdXtEpWOHjeiHTFucE8/mKDE8cKeRjQfaJYOgFIHLCIZLvkF
  T9QEbd1+0WRkXpOBzBsPr106s+M9IDMcGeaD8rk3NY8AitmRkKHdXVtt2Mm5HSXP
  CpQLg0vUcqe37TqUy0FomeSu95DXO0Ud7lKO7I/PPwkxaACfU9lr0uQm0gOV4EMW
  hzxqMUZUHpMz+CMh9AWsZWcaWLr/rpxeLb2/mO8+kzoRgRNCLBOD/l5QjBkqxKpr
  CdhRRBdgV/ZMFE6+vy2VtN8Be2gweTiKhS9lMUTHD3gjEOCgGfyN6v1eZDCjJG9h
  2Wuk63L2NIHFENaq5Cf4IIPTYweMfrYG1OnRVfkvstFUxlBqnMQAjPrM/YbITvpI
  29MN4jnLWVkqmy8dLszrlAiT70bT2dGnAbyefGr0UhHHxVXfP75K2mPITKrMvMot
  YsfL9ZkOH+WOYIAhF7VaEfV8KigEHbc/Er8vI3PTE5+Cxrxu

mongodb::server::replset: myrs
mongodb::server::replset_config:
  myrs:
    ensure: present
    members:
      - host: mongo-03:27017
        priority: 3
      - host: mongo-02:27017
        priority: 2
      - host: mongo-01:27017
        priority: 1

I'm using full Hiera config but this was not working because Mongo is giving "errmsg": "command replSetGetStatus requires authentication" which was not included in the auth condition.

Tested on Debian 10 with Mongo 4.4.10

This Pull Request (PR) fixes the following issues

n/a

@poloz-lab
Copy link
Contributor

I had the same problem and this fix solved my problem. Thanks !
I was using Debian 10 and Mongodb server 5.0.8.

@BDelacour
Copy link
Contributor Author

Hello !

May be @root-expert or @bastelfreak can watch this very tiny but useful PR ?

@bastelfreak bastelfreak added the bug Something isn't working label May 9, 2022
@bastelfreak bastelfreak merged commit 45d9bf4 into voxpupuli:master May 9, 2022
Copy link
Member

@root-expert root-expert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution @BDelacour !

Although not a Mongo expert this looks fair to me. Would you mind updating the title to something more descriptive, since PR titles make their way into out Changelog? Thanks!

@BDelacour BDelacour changed the title ReplicaSet with Auth creation Fix ReplicaSet with Auth creation (new error message to handle) May 9, 2022
@BDelacour
Copy link
Contributor Author

@root-expert Yes of course ! Is it better with this title ?

Thank you for merging :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants