# file: roles/wordpress/tasks/main.yml
#
# What to do to install and configure a WordPress instance
#
# Variables:: (in addition to those defined or documented in
#              ../vars/*.yml)

- name: Check whether WordPress is already installed
  stat:
    path: "{{ wp_path_config_php }}"
  register: _wp_config_php_stat

- name: "Backup"
  include: '{{ "backup.yml" if play_backup is match("yes") else "noop.yml" }}'

- name: "Create or restore (if requested)"
  include: '{{ "create-or-restore.yml" if play_create_or_restore is match("yes") else "noop.yml" }}'

- name: "Update themes and plugins (if requested)"
  include: '{{ "update.yml" if play_update is match("yes") else "noop.yml" }}'

- name: "Dump (if requested)"
  include: '{{ "dump.yml" if (play_dump is match("yes")) and (dump_local_dir is defined) else "noop.yml" }}'

- name: "Undump WXR (if requested)"
  include: '{{ "undump.yml" if (play_undump is match("yes")) and (undump_local_dir is defined) else "noop.yml" }}'

# file: roles/wordpress/tasks/main.yml
#
# What to do to install and configure a WordPress instance
#
# Variables:: (in addition to those defined or documented in
#              ../vars/*.yml)

- name: Check whether WordPress is already installed
  stat:
    path: "{{ wp_path_config_php }}"
  register: _wp_config_php_stat

- name: "Backup"
  include: '{{ "backup.yml" if play_backup is match("yes") else "noop.yml" }}'

- name: "Create or restore (if requested)"
  include: '{{ "create-or-restore.yml" if play_create_or_restore is match("yes") else "noop.yml" }}'

- name: "Update themes and plugins (if requested)"
  include: '{{ "update.yml" if play_update is match("yes") else "noop.yml" }}'

- name: "Dump (if requested)"
  include: '{{ "dump.yml" if (play_dump is match("yes") and dump_local_dir is defined) else "noop.yml" }}'

- name: "Undump WXR (if requested)"
  include: '{{ "undump.yml" if (play_undump is match("yes") and undump_local_dir is defined and wp_can.write_data) else "noop.yml" }}'

Fix dump / undump guards
Fix dump / undump guards
