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

Add resources to manage databases and users #185

Closed
stissot opened this issue Nov 13, 2017 · 9 comments
Closed

Add resources to manage databases and users #185

stissot opened this issue Nov 13, 2017 · 9 comments

Comments

@stissot
Copy link
Contributor

stissot commented Nov 13, 2017

I was using the mysql_database and mysql_user resources provided by the database cookbook, but this cookbook is now deprecated.

The reason why it's deprecated is because the authors think these resources should be implemented by each specialized database cookbook, to better use the full feature set of the underlying DB system.

So I think the mariadb cookbook should provide similar mariadb_database and mariadb_user resources/providers.

See also similar topic on the mysql cookbok: sous-chefs/mysql#522

@PowerKiKi
Copy link

There is also a similar topic, and conclusion, on sous-chefs/postgresql#437

Forking some database features into this repository sounds like a good idea. If the core team agree on that, then @stissot or myself, could work on a PR for that. Would that be OK ?

@stissot
Copy link
Contributor Author

stissot commented Nov 29, 2017

Any opinion on this from maintainers? If the idea is agreed, I will have some availability in the beginning of December to work on a PR.

@josephholsten
Copy link
Contributor

@stissot if you find those resources valuable, then please go for it! Do you need anything besides approval from the rest of us?

@stissot
Copy link
Contributor Author

stissot commented Jan 5, 2018

@josephholsten I've made a PR #187 can you please review it?

@jmadureira
Copy link

@stissot I've been trying out the mariadb_user resource and it fails on the second run. It appears that the load_current_value on the resource is not telling chef that the resource already exists so it tries to create a new one.

Also the PR #187 doesn't include any matchers for the new resources. I don't know if it is expected or not.

@infertux
Copy link

mariadb_user resource and it fails on the second run

@jmadureira I could not reproduce this issue. Is it happening with action :create? Here's what I tried:

diff --git i/test/fixtures/cookbooks/mariadb_test/recipes/resources.rb w/test/fixtures/cookbooks/mariadb_test/recipes/resources.rb
index ddc79b6..545b488 100644
--- i/test/fixtures/cookbooks/mariadb_test/recipes/resources.rb
+++ w/test/fixtures/cookbooks/mariadb_test/recipes/resources.rb
@@ -75,6 +75,12 @@ mariadb_user 'piggy' do
   action :create
 end
 
+# create user piggy again
+mariadb_user 'piggy2' do
+  username 'piggy'
+  action :create
+end
+
$ KITCHEN_LOCAL_YAML=.kitchen.dokken.yml kitchen converge resources-debian-8
[...]
  * mariadb_database[datatrout] action drop (up to date)
  * mariadb_user[piggy] action create (up to date)
  * mariadb_user[piggy2] action create (up to date)
  * mariadb_user[kermit] action drop (up to date)
[...]

I converged multiple times and Chef is properly detecting that the resource is up to date for me.

@jmadureira
Copy link

@infertux I was able to find out where the problem is and created the #191 with a possible fix.

@stissot
Copy link
Contributor Author

stissot commented Mar 22, 2018

@jmadureira see my answers on #191

@stissot stissot closed this as completed Mar 22, 2018
@lock
Copy link

lock bot commented Mar 22, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Mar 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants