---

# Tasks for installing pre-existing web app project onto VM.

- name: Custom core - Ensure web_app_project_root directory exists.
  file:
    path: "{{ web_app_project_root }}"
    state: directory
    # Don't recursively set permissions.  May cause dirty repo.
    recurse: no
    mode: 0775
  become: yes
  when: project_type == "wordpress" and web_app_project_root is defined

- name: Fetch random salts for wp-config.php
  command: curl https://api.wordpress.org/secret-key/1.1/salt/
  register: 'wp_salt'

- name: Copy wp-config.php file
  template:
    # Src is relative to provisioning directory.
    src: "../scripts/post-provision/templates/wp-config.php.j2"
    dest: "{{wp_install_dir}}/wp-config.php"

---

# Tasks for installing pre-existing web app project onto VM.

- name: Custom core - Ensure web_app_project_root directory exists.
  file:
    path: "{{ web_app_project_root }}"
    state: directory
    # Don't recursively set permissions.  May cause dirty repo.
    recurse: no
    mode: 0775
  become: yes
  when: project_type == "wordpress" and web_app_project_root is defined

- name: Fetch random salts for wp-config.php
  command: curl https://api.wordpress.org/secret-key/1.1/salt/
  register: 'wp_salt'
  when: project_type == "wordpress" and web_app_project_root is defined

- name: Copy wp-config.php file
  template:
    # Src is relative to provisioning directory.
    src: "../scripts/post-provision/templates/wp-config.php.j2"
    dest: "{{wp_install_dir}}/wp-config.php"
  when: project_type == "wordpress" and web_app_project_root is defined

Add checks for WordPress `wp-config.php` tasks
Add checks for WordPress `wp-config.php` tasks

Adds checks for conditional execution.