pdns-ansible
pdns-ansible copied to clipboard
Allow mysql-specific tasks to run based when using a gmysql backend, not on pdns_mysql_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 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.