diff --git a/README.rst b/README.rst
index f3d289d9a0875477c6e3958f9fcd9e8503a20881..0deedc674c86744e71e3992cddc012053785fe10 100644
--- a/README.rst
+++ b/README.rst
@@ -14,7 +14,10 @@ Debian Jessie.
 Role Variables
 --------------
 
-None.
+::
+
+    fqdn: ansible_fqdn #Site FQDN.
+    force_ssl: True #Force SSL for site URL.
 
 Dependencies
 ------------
diff --git a/defaults/main.yml b/defaults/main.yml
index fd62c7bf83451f128fd9e907c26a536acdb39497..0ffee86827186cc52ddd4db1f01b08ca19813ef2 100644
--- a/defaults/main.yml
+++ b/defaults/main.yml
@@ -1,2 +1,5 @@
 ---
 # defaults file for wordpress
+
+fqdn: '{{ ansible_fqdn }}'
+force_ssl: True
diff --git a/files/backup.sh b/files/backup.sh
new file mode 100644
index 0000000000000000000000000000000000000000..852a5976466076415324517073a369513ca6454e
--- /dev/null
+++ b/files/backup.sh
@@ -0,0 +1,3 @@
+#!/bin/sh -e
+cd /var/www
+tar -cf /var/backups/wordpress.tar wordpress
diff --git a/handlers/main.yml b/handlers/main.yml
index bd882029177468814346a73526eb5b1b2391db27..7222903fc72192386c3887dbe3c820c3243a8314 100644
--- a/handlers/main.yml
+++ b/handlers/main.yml
@@ -10,8 +10,3 @@
   service:
     name: php5-fpm
     state: restarted
-
-- name: Restart MySQL
-  service:
-    name: mysql
-    state: restarted
diff --git a/meta/main.yml b/meta/main.yml
index 59e050dd653fbe7153d4f5b19bc2d55fba23ec03..1a3c48bcae80c97c20ca59217cf96ce642d2cf27 100644
--- a/meta/main.yml
+++ b/meta/main.yml
@@ -11,4 +11,8 @@ galaxy_info:
     - jessie
   categories:
     - web
-dependencies: []
+dependencies:
+  - role: mysql
+    mysql_database: wordpress
+    mysql_user: wordpress
+    mysql_password: wordpress
diff --git a/tasks/main.yml b/tasks/main.yml
index dbec7a70d12fbe118db40341e3c3e1886f0ea776..8c1ea328ded624a993db97e85751a960eb96ae42 100644
--- a/tasks/main.yml
+++ b/tasks/main.yml
@@ -1,9 +1,19 @@
 ---
-# tasks file for wordpress
+# tasks file for ansible-wordpress
 
-- include: php.yml
-
-- include: mysql.yml
+- name: apt install prerequisites
+  apt:
+    name: '{{ item }}'
+    state: present
+    update_cache: yes
+    cache_valid_time: 3600
+  with_items:
+    - nginx-light
+    - php5-fpm
+    - php5-cli
+    - php5-mysql
+    - php5-gd
+    - cron
 
 - name: Get tarball
   get_url:
@@ -12,8 +22,10 @@
     owner: root
     group: root
     mode: '0644'
+  register: wordpress_download
 
 - name: Unpack tarball
+  when: wordpress_download|changed
   unarchive:
     copy: no
     dest: /var/www
@@ -21,7 +33,6 @@
     owner: root
     group: root
     mode: '0755'
-    creates: /var/www/wordpress/index.php
 
 - name: Configure Wordpress
   template:
@@ -38,24 +49,27 @@
     recurse: yes
     state: directory
 
-- name: Create backup destination
-  file:
-    path: /var/backups
-    state: directory
+- name: Add daily backup job
+  copy:
+    src: backup.sh
+    dest: /etc/cron.daily/wordpress
+    owner: root
+    group: root
     mode: '0755'
-    owner: nobody
-    group: nogroup
-
-- name: Add daily Wordpress backup and cleanup jobs
-  cron:
-    special_time: daily
-    user: nobody
-    name: '{{ item.name }}'
-    job: '{{ item.job }}'
-  with_items:
-    - name: Daily MySQL backup
-      job: 'mysqldump --user root --single-transaction --force wordpress > /var/backups/wordpress-$(date -I).sql'
-    - name: Daily backup cleanup
-      job: 'find /var/backups -atime 30 -delete'
-    - name: Daily Wordpress backup
-      job: 'tar -cf /var/backups/wordpress-$(date -I).tar /var/www/wordpress'
+
+- name: Disable default Nginx site
+  file:
+    path: /etc/nginx/sites-enabled/default
+    state: absent
+  notify:
+    - Restart Nginx
+
+- name: Add Wordpress site to Nginx
+  template:
+    src: wordpress.j2
+    dest: /etc/nginx/sites-enabled/wordpress
+    owner: root
+    group: root
+    mode: '0644'
+  notify:
+    - Restart Nginx
diff --git a/tasks/mysql.yml b/tasks/mysql.yml
deleted file mode 100644
index 9aad647c33b540dee218d52bec906fc12a749803..0000000000000000000000000000000000000000
--- a/tasks/mysql.yml
+++ /dev/null
@@ -1,26 +0,0 @@
----
-- name: apt-get install mysql
-  apt:
-    name: '{{ item }}'
-    state: present
-    update_cache: yes
-    cache_valid_time: 3600
-  with_items:
-    - mysql-server
-    - mysql-client
-    - python-mysqldb
-    - anacron
-
-- name: Create Wordpress MySQL database
-  mysql_db:
-    collation: utf8_general_ci
-    encoding: utf8
-    name: wordpress
-    state: present
-
-- name: Create Wordpress MySQL account
-  mysql_user:
-    name: wordpress
-    password: wordpress
-    priv: 'wordpress.*:SELECT,INSERT,UPDATE,DELETE,CREATE,INDEX'
-    state: present
diff --git a/tasks/php.yml b/tasks/php.yml
deleted file mode 100644
index 0705cd5ad0ed794dd23fd56da5cf2017ec200559..0000000000000000000000000000000000000000
--- a/tasks/php.yml
+++ /dev/null
@@ -1,30 +0,0 @@
----
-- name: apt-get install php-fpm, nginx prerequisites
-  apt:
-    name: '{{ item }}'
-    state: present
-    update_cache: yes
-    cache_valid_time: 3600
-  with_items:
-    - nginx-light
-    - php5-fpm
-    - php5-cli
-    - php5-mysql
-    - php5-gd
-
-- name: Disable default Nginx site
-  file:
-    path: /etc/nginx/sites-enabled/default
-    state: absent
-  notify:
-    - Restart Nginx
-
-- name: Add Wordpress site to Nginx
-  template:
-    src: wordpress.j2
-    dest: /etc/nginx/sites-enabled/wordpress
-    owner: root
-    group: root
-    mode: '0644'
-  notify:
-    - Restart Nginx
diff --git a/templates/wp-config.php.j2 b/templates/wp-config.php.j2
index 02e96999b52f4590ceef125d4659b431d72407b2..aa04290c9754156cc870a873840658c3738b3edd 100644
--- a/templates/wp-config.php.j2
+++ b/templates/wp-config.php.j2
@@ -1,90 +1,95 @@
-<?php
-/**
- * The base configuration for WordPress
- *
- * The wp-config.php creation script uses this file during the
- * installation. You don't have to use the web site, you can
- * copy this file to "wp-config.php" and fill in the values.
- *
- * This file contains the following configurations:
- *
- * * MySQL settings
- * * Secret keys
- * * Database table prefix
- * * ABSPATH
- *
- * @link https://codex.wordpress.org/Editing_wp-config.php
- *
- * @package WordPress
- */
-
-// ** MySQL settings - You can get this info from your web host ** //
-/** The name of the database for WordPress */
-define('DB_NAME', 'wordpress');
-
-/** MySQL database username */
-define('DB_USER', 'wordpress');
-
-/** MySQL database password */
-define('DB_PASSWORD', 'wordpress');
-
-/** MySQL hostname */
-define('DB_HOST', 'localhost');
-
-/** Database Charset to use in creating database tables. */
-define('DB_CHARSET', 'utf8');
-
-/** The Database Collate type. Don't change this if in doubt. */
-define('DB_COLLATE', 'utf8_general_ci');
-
-/**#@+
- * Authentication Unique Keys and Salts.
- *
- * Change these to different unique phrases!
- * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}
- * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
- *
- * @since 2.6.0
- */
-define('AUTH_KEY',         'put your unique phrase here');
-define('SECURE_AUTH_KEY',  'put your unique phrase here');
-define('LOGGED_IN_KEY',    'put your unique phrase here');
-define('NONCE_KEY',        'put your unique phrase here');
-define('AUTH_SALT',        'put your unique phrase here');
-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');
-
-/**#@-*/
-
-/**
- * WordPress Database Table prefix.
- *
- * You can have multiple installations in one database if you give each
- * a unique prefix. Only numbers, letters, and underscores please!
- */
-$table_prefix  = 'wp_';
-
-/**
- * For developers: WordPress debugging mode.
- *
- * Change this to true to enable the display of notices during development.
- * It is strongly recommended that plugin and theme developers use WP_DEBUG
- * in their development environments.
- *
- * For information on other constants that can be used for debugging,
- * visit the Codex.
- *
- * @link https://codex.wordpress.org/Debugging_in_WordPress
- */
-define('WP_DEBUG', false);
-
-/* That's all, stop editing! Happy blogging. */
-
-/** Absolute path to the WordPress directory. */
-if ( !defined('ABSPATH') )
-	define('ABSPATH', dirname(__FILE__) . '/');
-
-/** Sets up WordPress vars and included files. */
-require_once(ABSPATH . 'wp-settings.php');
+<?php
+/**
+ * The base configuration for WordPress
+ *
+ * The wp-config.php creation script uses this file during the
+ * installation. You don't have to use the web site, you can
+ * copy this file to "wp-config.php" and fill in the values.
+ *
+ * This file contains the following configurations:
+ *
+ * * MySQL settings
+ * * Secret keys
+ * * Database table prefix
+ * * ABSPATH
+ *
+ * @link https://codex.wordpress.org/Editing_wp-config.php
+ *
+ * @package WordPress
+ */
+
+// ** MySQL settings - You can get this info from your web host ** //
+/** The name of the database for WordPress */
+define('DB_NAME', 'wordpress');
+
+/** MySQL database username */
+define('DB_USER', 'wordpress');
+
+/** MySQL database password */
+define('DB_PASSWORD', 'wordpress');
+
+/** MySQL hostname */
+define('DB_HOST', 'localhost');
+
+/** Database Charset to use in creating database tables. */
+define('DB_CHARSET', 'utf8');
+
+/** The Database Collate type. Don't change this if in doubt. */
+define('DB_COLLATE', 'utf8_general_ci');
+
+/**#@+
+ * Authentication Unique Keys and Salts.
+ *
+ * Change these to different unique phrases!
+ * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}
+ * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
+ *
+ * @since 2.6.0
+ */
+define('AUTH_KEY',         'put your unique phrase here');
+define('SECURE_AUTH_KEY',  'put your unique phrase here');
+define('LOGGED_IN_KEY',    'put your unique phrase here');
+define('NONCE_KEY',        'put your unique phrase here');
+define('AUTH_SALT',        'put your unique phrase here');
+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 %}
+$_SERVER['HTTPS']='on';
+{% endif %}
+
+/**#@-*/
+
+/**
+ * WordPress Database Table prefix.
+ *
+ * You can have multiple installations in one database if you give each
+ * a unique prefix. Only numbers, letters, and underscores please!
+ */
+$table_prefix  = 'wp_';
+
+/**
+ * For developers: WordPress debugging mode.
+ *
+ * Change this to true to enable the display of notices during development.
+ * It is strongly recommended that plugin and theme developers use WP_DEBUG
+ * in their development environments.
+ *
+ * For information on other constants that can be used for debugging,
+ * visit the Codex.
+ *
+ * @link https://codex.wordpress.org/Debugging_in_WordPress
+ */
+define('WP_DEBUG', false);
+
+/* That's all, stop editing! Happy blogging. */
+
+/** Absolute path to the WordPress directory. */
+if ( !defined('ABSPATH') )
+	define('ABSPATH', dirname(__FILE__) . '/');
+
+/** Sets up WordPress vars and included files. */
+require_once(ABSPATH . 'wp-settings.php');