Skip to content

Commit

Permalink
Fix condition for permalink structure task
Browse files Browse the repository at this point in the history
  • Loading branch information
fullyint committed Aug 27, 2016
1 parent 5b50d79 commit def7dfb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions roles/wordpress-install/tasks/main.yml
Expand Up @@ -51,17 +51,17 @@
--admin_email="{{ item.value.admin_email }}"
args:
chdir: "{{ www_root }}/{{ item.key }}/{{ item.value.current_path | default('current') }}/"
register: wp_install_results
register: wp_multisite_install_results
with_dict: "{{ wordpress_sites }}"
when: item.value.site_install | default(true) and item.value.multisite.enabled | default(false)
changed_when: "'The network already exists.' not in wp_install_results.stdout"
changed_when: "'The network already exists.' not in wp_multisite_install_results.stdout"

- name: Setup Permalink Structure
command: wp rewrite structure {{ item.value.initial_permalink_structure | default("/%postname%/") }} --allow-root
args:
chdir: "{{ www_root }}/{{ item.key }}/{{ item.value.current_path | default('current') }}/"
with_dict: "{{ wordpress_sites }}"
when: wp_install_results | changed
when: wp_install_results | changed or wp_multisite_install_results | changed

- name: Update WP Multisite Home URL
command: wp option update home {{ site_env.wp_home }} --allow-root
Expand Down

0 comments on commit def7dfb

Please sign in to comment.