Prevent some tasks from repeating

This commit is contained in:
Kris Lamoureux 2020-01-22 23:31:54 -05:00
parent 370c3c6300
commit d1ad35d0c1
Signed by: kris
GPG Key ID: 3EDA9C3441EDA925
2 changed files with 8 additions and 0 deletions

View File

@ -96,6 +96,7 @@
--admin-user {{ nc_admin }} --admin-pass {{ nc_admin_pass }} \ --admin-user {{ nc_admin }} --admin-pass {{ nc_admin_pass }} \
--data-dir {{ nc_dir }}/public_html/data --data-dir {{ nc_dir }}/public_html/data
become_user: www-data become_user: www-data
register: nextcloud_install
args: args:
chdir: "{{ nc_dir }}/public_html" chdir: "{{ nc_dir }}/public_html"
creates: "{{ nc_dir }}/public_html/config/config.php" creates: "{{ nc_dir }}/public_html/config/config.php"
@ -106,6 +107,7 @@
become_user: www-data become_user: www-data
args: args:
chdir: "{{ nc_dir }}/public_html" chdir: "{{ nc_dir }}/public_html"
when: nextcloud_install.changed
- name: "Enable Apache2 Module: rewrite" - name: "Enable Apache2 Module: rewrite"
apache2_module: name=rewrite state=present apache2_module: name=rewrite state=present

View File

@ -58,10 +58,16 @@
group: "www-data" group: "www-data"
remote_src: yes remote_src: yes
- name: Stat WordPress Salts
stat:
path: "{{ wp_dir }}/salts.txt"
register: salts
- name: Generate Keys and Salts - name: Generate Keys and Salts
get_url: get_url:
url: https://api.wordpress.org/secret-key/1.1/salt/ url: https://api.wordpress.org/secret-key/1.1/salt/
dest: "{{ wp_dir }}/salts.txt" dest: "{{ wp_dir }}/salts.txt"
when: not salts.stat.exists
- name: Grab Keys and Salts - name: Grab Keys and Salts
slurp: src="{{ wp_dir }}/salts.txt" slurp: src="{{ wp_dir }}/salts.txt"