diff --git a/roles/seafile/tasks/install.yml b/roles/seafile/tasks/install.yml index 40e493e..9010029 100644 --- a/roles/seafile/tasks/install.yml +++ b/roles/seafile/tasks/install.yml @@ -251,3 +251,21 @@ - pre - post tags: seafile + +- name: Check if there are custom office templates + local_action: stat path=config/{{ inventory_hostname }}/seafile/office-template/empty.{{ item }} + register: seafile_custom_office_template + vars: + ansible_become: False + loop: + - docx + - pptx + - xlsx + tags: seafile + +- name: Override office templates + copy: + src: "{{ item.stat.exists | ternary('config/' + inventory_hostname + '/seafile/office-template/empty.','office-template/empty.' ) }}{{ item.item }}" + dest: "{{ seafile_root_dir }}/seafile-server/seahub/media/office-template/" + loop: "{{ seafile_custom_office_template.results }}" + tags: seafile