diff --git a/README.rst b/README.rst index e88501d78a0ff8ae4106bda3acf8f854ef7a9387..bce6d32554e2f11302993641cb52fba68d4c07dc 100644 --- a/README.rst +++ b/README.rst @@ -16,8 +16,9 @@ Role Variables :: - fqdn: ansible_fqdn #Site FQDN. - force_ssl: True #Force SSL for site URL. + wordpress_fqdn: {{ ansible_fqdn }} #Site FQDN. + wordpress_force_https: False #Force SSL for site URL. + wordpress_mysql_server: #Address for the MySQL server. Dependencies ------------ diff --git a/defaults/main.yml b/defaults/main.yml index 0ffee86827186cc52ddd4db1f01b08ca19813ef2..fb9a4463951d79f4a254df968954b98589848720 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,5 +1,6 @@ --- # defaults file for wordpress -fqdn: '{{ ansible_fqdn }}' -force_ssl: True +wordpress_fqdn: '{{ ansible_fqdn }}' +wordpress_force_https: False +wordpress_mysql_server: localhost diff --git a/templates/wp-config.php.j2 b/templates/wp-config.php.j2 index aa04290c9754156cc870a873840658c3738b3edd..cc85ba4f91c94151f2fc7accc005ca3439292d89 100644 --- a/templates/wp-config.php.j2 +++ b/templates/wp-config.php.j2 @@ -55,9 +55,9 @@ define('SECURE_AUTH_SALT', 'put your unique phrase here'); define('LOGGED_IN_SALT', 'put your unique phrase here'); define('NONCE_SALT', 'put your unique phrase here'); define('FS_METHOD', 'direct'); -define('WP_HOME', '{{ fqdn }}'); -define('WP_SITEURL', '{{ fqdn }}'); -{% if force_ssl %} +define('WP_HOME', '{{ wordpress_fqdn }}'); +define('WP_SITEURL', '{{ wordpress_fqdn }}'); +{% if wordpress_force_https|default(False) %} $_SERVER['HTTPS']='on'; {% endif %}