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

Allow mysql-specific tasks to run based when using a gmysql backend, not on pdns_mysql_databases_credentials #186

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

franklouwers
Copy link
Contributor

When we have a gmysql backend, we do still want to run most of the Mysql-specific setup, apart from the db/user creation. Previously, the pdns_mysql_databases_credentials var was used to trigger this.

However, pdns_mysql_databases_credentials contains the database 'root' credentials, and is used when creating the DB/User. Sometimes we don't need/have the root credentials, as the db might be externally provisioned. Yet we still need the mysql-backend dependencies, and might (optionally) also load the default schema.

This PR looks at the defined backends, and will trigger the MySQL tasks if it detects a gmysql backend.

Additionally, we introduce a boolean parameter pdns_mysql_schema_load (default true) so we can allow the user to optionally skip loading the default schema.

Lastly, it adds a default host of "localhost" if not specified in the pdns_backends['gmysql'] struct. TODO for later: if host isn't defined, use the unix socket instead of localhost.

…_databases_credentials

When we have a gmysql backend, we do still want to run most of the
Mysql-specific setup, apart from the db/user creation. Previously, the
pdns_mysql_databases_credentials var was used to trigger this.

However, pdns_mysql_databases_credentials contains the database 'root'
credentials, and is used when creating the DB/User. Sometimes we don't
need/have the root credentials, as the db might be externally
provisioned. Yet we still need the mysql-backend dependencies, and might
(optionally) also load the default schema.

This commit looks at the defined backends, and will trigger the MySQL tasks
if it detects a gmysql backend.

Additionally, we introduce a boolean parameter `pdns_mysql_schema_load`
(default true) so we can allow the user to optionally skip loading the
default schema.
@franklouwers franklouwers changed the title Allow mysql-specific tasks to run based on backend, not on pdns_mysql_databases_credentials Allow mysql-specific tasks to run based when using a gmysql backend, not on pdns_mysql_databases_credentials Aug 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant