-
Notifications
You must be signed in to change notification settings - Fork 13
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
Possible removal of MySQL resources #177
Comments
Why? I could understand removing users and grant. But I would certainly keep a mysql resource with the ability to seed the initial mysql db. |
This definitely isn't a final decision -- more of a poll / open question to come back to later. One design characteristic I want to try to stick to is ensuring Waffles isn't doing something another complementary tool is doing better. The Waffles MySQL resources are key to bootstrapping a MySQL server (single or cluster). An example can be seen here. What I'm debating is whether or not they would serve a purpose beyond that. Given they're so key to bootstrapping, that alone might make them worthwhile to keep in Waffles, though. Beyond that, though, I feel like having the MySQL resources included in configurations of non-MySQL servers is clunky. As an example, here's the configuration of a fictional wiki server: Terraform: resource "openstack_compute_instance_v2" "dokuwiki" {
name = "dokuwiki"
image_name = "Ubuntu 14.04"
etc etc
provisioner "file" {
source = "files/waffles-dokuwiki.sh"
destination = "/home/ubuntu/waffles-dokuwiki.sh"
}
provisioner "remote-exec" {
inline = [ "sudo bash /home/ubuntu/waffles-dokuwiki.sh" ]
}
} and apt.pkg --package mysql-client
apt.pkg --package dokuwiki
mysql.mycnf --file /root/.my.cnf --user root --password password --host mysql.example.com
mysql.database --name dokuwiki
mysql.user --user dokuwiki --host $(hostname) --password password
mysql.grant --user dokuwiki --host $(hostname) --database dokuwiki --privileges ALL
os.file --source dokuwiki.conf --destination /var/www/dokuwiki/dokuwiki.conf By using the MySQL Terraform resources, it would look like: Terraform: provider "mysql" {
username = "root"
password = "password"
host = "mysql.example.com"
}
resource "mysql_database" {
name = "dokuwiki"
}
resource "mysql_user" {
user = "dokuwiki"
host = "foobar.com"
}
resource "mysql_grant" {
user = "dokuwiki"
host = "foobar.com"
database = "dokuwiki"
privileges = ["ALL"]
}
resource "openstack_compute_instance_v2" "dokuwiki" {
name = "dokuwiki"
image_name = "Ubuntu 14.04"
etc etc
provisioner "file" {
source = "files/waffles-dokuwiki.sh"
destination = "/home/ubuntu/waffles-dokuwiki.sh"
}
provisioner "remote-exec" {
inline = [ "sudo bash /home/ubuntu/waffles-dokuwiki.sh" ]
}
} and apt.pkg --package dokuwiki
os.file --source dokuwiki.conf --destination /var/www/dokuwiki/dokuwiki.conf The design between the two is definitely subjective -- that's why I'm still debating this. But the main reasons I brought this topic up is because:
Ultimately, I think the resources will stay in Waffles. This whole issue is more or less just thinking out loud and to get input from other people -- which very much has a bearing on the decision, so any push back is definitely appreciated. 😄 |
Especially to help in bootstrapping new MySQL servers, I've decided to leave these resources in. :) |
I've written a
mysql_user
andmysql_grant
resource for Terraform to go along with the existingmysql_database
resource. If those get merge, I might remove the MySQL resources from Waffles.The text was updated successfully, but these errors were encountered: