sc-mongodb icon indicating copy to clipboard operation
sc-mongodb copied to clipboard

Support for mongodb version 7.0 in Ubuntu 22.04

Open Galactic21 opened this issue 6 months ago • 0 comments

Good afternoon, with this cookbook I managed to create an instance in focal (Ubuntu 20.04) with version 4.4 of mongodb. So I wanted to know if this cookbook is compatible with installing the new version of mongodb (7.0.4) with the Ubuntu 22.04 operating system. I've already tried but I get a series of errors, particularly when creating the admin.

image

image

my user.management.rb:

`#

Cookbook:: mongodb

Recipe:: user_management

Copyright:: 2011, edelight GmbH

Authors:

Markus Korn [email protected]

Copyright:: 2016-2017, Grant Ridder

Licensed under the Apache License, Version 2.0 (the "License");

you may not use this file except in compliance with the License.

You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software

distributed under the License is distributed on an "AS IS" BASIS,

WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

See the License for the specific language governing permissions and

limitations under the License.

include_recipe 'sc-mongodb::mongo_gem'

users = [] admin = [node['mongodb']['admin']]

If authentication is required,

add the admin to the users array for adding/updating

users.concat(node['mongodb']['users'])

admin.each do |user| mongodb_user user['username'] do password user['password'] roles user['roles'] database user['database'] connection node['mongodb'] #mechanism user['mechanism'] if node.recipe?('sc-mongodb::mongos') || node.recipe?('sc-mongodb::replicaset') # If it's a replicaset or mongos, don't make any users until the end action :nothing subscribes :add, 'ruby_block[config_replicaset]', :delayed subscribes :add, 'ruby_block[config_sharding]', :delayed else action user['action'] || :add end end end

Add each user specified in attributes

users.each do |user| mongodb_user user['username'] do password user['password'] roles user['roles'] database user['database'] connection node['mongodb'] #mechanism user['mechanism'] if node.recipe?('sc-mongodb::mongos') || node.recipe?('sc-mongodb::replicaset') # If it's a replicaset or mongos, don't make any users until the end action :nothing subscribes :add, 'ruby_block[config_replicaset]', :delayed subscribes :add, 'ruby_block[config_sharding]', :delayed else action user['action'] || :add end end end`

It is important to have help on this matter so that everything is up to date. Cheers.

Galactic21 avatar Dec 27 '23 15:12 Galactic21