Skip to content

Commit

Permalink
Merge pull request #8 from lalmeras/fix-user-ini
Browse files Browse the repository at this point in the history
Reorder perms and conf checks when upgrading
  • Loading branch information
rbicker authored May 14, 2018
2 parents ba06fa5 + ea79e86 commit fa42f84
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 18 deletions.
13 changes: 13 additions & 0 deletions tasks/filesystem.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
# perform fixes on filesystem (selinux, perms,
# configuration inside nextcloud_web_root)

- name: ensure .user.ini config is present
template:
src: user.ini.j2
dest: '{{ nextcloud_web_root }}/.user.ini'
notify:
- reload nginx
- reload php-fpm

- import_tasks: 'permissions.yml'
2 changes: 1 addition & 1 deletion tasks/installation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
remote_src: true
dest: '{{ nextcloud_web_root }}'

- import_tasks: 'permissions.yml'
- import_tasks: 'filesystem.yml'

- name: installation - ensure nextcloud installation is finished
command: 'php {{ nextcloud_web_root }}/occ maintenance:install --database "mysql" --database-name "{{ nextcloud_mysql_db }}" --database-user "{{ nextcloud_mysql_user }}" --database-pass "{{ nextcloud_mysql_pw }}" --admin-user "{{ nextcloud_admin_user }}" --admin-pass "{{ nextcloud_admin_pw }}" --data-dir "{{ nextcloud_data_root }}"'
Expand Down
28 changes: 11 additions & 17 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -238,22 +238,16 @@
- import_tasks: 'installation.yml'
when: new_installation.changed

- name: ensure .user.ini config is present
template:
src: user.ini.j2
dest: '{{ nextcloud_web_root }}/.user.ini'
notify:
- reload nginx
- reload php-fpm

- name: performance tuning - ensure the nextcloud cronjob exists and runs every 15 min
cron:
name: nextcloud
minute: 15
user: nginx
job: 'php -f {{ nextcloud_web_root | quote }}/cron.php'

- import_tasks: 'permissions.yml'

- import_tasks: 'upgrade.yml'
when: nextcloud_upgrade

# call filesystem checks if not done by previous tasks
- import_tasks: filesystem.yml
when: not new_installation.changed and not new_installation.changed

- name: performance tuning - ensure the nextcloud cronjob exists and runs every 15 min
cron:
name: nextcloud
minute: 15
user: nginx
job: 'php -f {{ nextcloud_web_root | quote }}/cron.php'
2 changes: 2 additions & 0 deletions tasks/upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
register: nextcloud_update_result
changed_when: false # unsure if upgrade has been done -> inform later

- import_tasks: filesystem.yml

- name: get current nextcloud version, after running updater.phar
shell: '{{ nextcloud_web_root }}/occ -V'
become: true
Expand Down

0 comments on commit fa42f84

Please sign in to comment.