---
- name: "Download wordpress"
  become: yes
  get_url: "url={{ storyteller_wp_file_url }}/{{ storyteller_wp_file }} dest=/srv/{{ storyteller_wp_file }} sha256sum='{{ storyteller_wp_sha256sum }}'"

- name: "Extract archive"
  become: yes
  unarchive: "src=/srv/{{ storyteller_wp_file }} dest=/srv copy=no creates=/srv/wordpress"

- name: "Detect if there is a wp-config file"
  become: yes
  stat: path=/srv/wordpress/wp-config.php
  register: wp_config

- name: "Fetch salts for wordpress config"
  command: get_url https://api.wordpress.org/secret-key/1.1/salt/
  register: "wp_salt"
  when: not wp_config.stat.exists

- name: "Copy Wordpress config"
  become: yes
  template: src=wp-config.php dest=/srv/wordpress/
  when: not wp_config.stat.exists

- name: "Change ownership of Wordpress installation"
  become: yes
  file: path=/srv/wordpress/ owner=www-data group=www-data state=directory recurse=yes

---
- name: "Download wordpress"
  become: yes
  get_url: "url={{ storyteller_wp_file_url }}/{{ storyteller_wp_file }} dest=/srv/{{ storyteller_wp_file }} sha256sum='{{ storyteller_wp_sha256sum }}'"

- name: "Extract archive"
  become: yes
  unarchive: "src=/srv/{{ storyteller_wp_file }} dest=/srv copy=no creates=/srv/wordpress"

- name: "Detect if there is a wp-config file"
  become: yes
  stat: path=/srv/wordpress/wp-config.php
  register: wp_config

- name: "Fetch salts for wordpress config"
  command: curl https://api.wordpress.org/secret-key/1.1/salt/
  register: "wp_salt"
  when: not wp_config.stat.exists

- name: "Copy Wordpress config"
  become: yes
  template: src=wp-config.php dest=/srv/wordpress/
  when: not wp_config.stat.exists

- name: "Change ownership of Wordpress installation"
  become: yes
  file: path=/srv/wordpress/ owner=www-data group=www-data state=directory recurse=yes

Revert "replaced curl with get_url"
Revert "replaced curl with get_url"

This reverts commit f29409be430c384c9ef96b254931aa69f6d5287f.
