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 #187

Merged
merged 4 commits into from Mar 5, 2018
Merged

Add resources to manage databases and users #187

merged 4 commits into from Mar 5, 2018

Conversation

stissot
Copy link
Contributor

@stissot stissot commented Jan 4, 2018

This adds 2 new Custom Resources mariadb_database to manage databases and run queries on them, and mariadb_user to grant access to users. This used to be provided by the now deprecated database cookbook.

Usage example

mariadb_database 'databass' do
  action :create
end

mariadb_database 'datatrout' do
  action :drop
end

mariadb_user 'fozzie' do
  database_name 'databass'
  password 'wokkawokka'
  host 'mars'
  privileges [:select, :update, :insert]
  action :grant
end

mariadb_database 'flush privileges' do
  database_name 'databass'
  sql 'flush privileges'
  action :query
end

The resources use the mysql2 gem (automatically installed when missing) to established a control connection to the MariaDB server (by default as root@localhost using password).

Integration tests are included using Inspec.

I haven't updated the README yet, I'm waiting for maintainers' approval first.

@stissot stissot changed the title Add resources to manage databases and users #185 Add resources to manage databases and users Jan 4, 2018
@shoekstra
Copy link
Contributor

Looks good to me!

If you would be so kind has to update the the CHANGELOG and the README that would be great 👍

Copy link

@PowerKiKi PowerKiKi left a comment

Choose a reason for hiding this comment

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

LGTM

@stissot
Copy link
Contributor Author

stissot commented Jan 14, 2018

Thanks for your feedback. I have updated the CHANGELOG and README.

@stissot
Copy link
Contributor Author

stissot commented Jan 29, 2018

I've added a new test suite "resources" which pass successfully. I think the failure on the other suites are temporary (apt repository not reachable) and not related to my changes.
@josephholsten can you please review?

@stissot
Copy link
Contributor Author

stissot commented Feb 13, 2018

@shoekstra Can you please review ?

@damacus
Copy link
Member

damacus commented Mar 5, 2018

This is brilliant. thanks very much @stissot !

merging in now the tests pass.

@damacus damacus merged commit 9382396 into sous-chefs:master Mar 5, 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

Successfully merging this pull request may close these issues.

None yet

4 participants