From 10cdbfd5b5ff86f4cfa1d0ff8952d9d9eede2aad Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Wed, 11 Apr 2018 18:07:28 +0200 Subject: [PATCH] Add a variable to facilitate the use of an external MySQL database. --- wordpress/defaults/main.yml | 2 ++ wordpress/templates/wp-config.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/wordpress/defaults/main.yml b/wordpress/defaults/main.yml index 257670a9..7eae7cf3 100644 --- a/wordpress/defaults/main.yml +++ b/wordpress/defaults/main.yml @@ -39,6 +39,8 @@ wordpress_local_mysql: True wordpress_db_name: wp_db wordpress_db_user: wp_user +# If you change that, you must set the wordpress_local_mysql variable to False +wordpress_db_host: localhost wordpress_db_table_prefix: 'mywp_' # wordpress_db_pwd: 'use a vault file' diff --git a/wordpress/templates/wp-config.php b/wordpress/templates/wp-config.php index 96a1ea36..bf21fe46 100644 --- a/wordpress/templates/wp-config.php +++ b/wordpress/templates/wp-config.php @@ -2,7 +2,7 @@ define("DB_NAME", "{{ wordpress_db_name }}"); define("DB_USER", "{{ wordpress_db_user }}"); define("DB_PASSWORD", "{{ wordpress_db_pwd }}"); -define("DB_HOST", "localhost"); +define("DB_HOST", "{{ wordpress_db_host }}"); define("DB_CHARSET", "utf8"); define("DB_COLLATE", "");