diff --git a/roles/seafile/files/avatars/default-non-register.jpg b/roles/seafile/files/avatars/default-non-register.jpg new file mode 100644 index 0000000..3612eb4 Binary files /dev/null and b/roles/seafile/files/avatars/default-non-register.jpg differ diff --git a/roles/seafile/files/avatars/default.png b/roles/seafile/files/avatars/default.png new file mode 100644 index 0000000..4b6f92d Binary files /dev/null and b/roles/seafile/files/avatars/default.png differ diff --git a/roles/seafile/tasks/directories.yml b/roles/seafile/tasks/directories.yml index c21c233..8f170ed 100644 --- a/roles/seafile/tasks/directories.yml +++ b/roles/seafile/tasks/directories.yml @@ -1,33 +1,35 @@ --- - name: Create directories - file: path={{ item.dir }} state=directory owner={{ item.owner | default(omit) }} group={{ item.group | default(omit) }} mode={{ item.mode | default(omit) }} + file: path={{ item.dir }} state=directory owner={{ item.owner | default(seafile_user) }} group={{ item.group | default(seafile_user) }} mode={{ item.mode | default(omit) }} with_items: - dir: "{{ seafile_root_dir }}/tmp" mode: 700 + owner: root + group: root - dir: "{{ seafile_root_dir }}/meta" mode: 700 + owner: root + group: root - dir: "{{ seafile_root_dir }}/archives" mode: 700 + owner: root + group: root - dir: "{{ seafile_root_dir }}" - dir: "{{ seafile_root_dir }}/fuse" - dir: "{{ seafile_root_dir }}/seafile-server" - dir: "{{ seafile_root_dir }}/conf" - dir: "{{ seafile_root_dir }}/ccnet" + mode: 770 - dir: "{{ seafile_root_dir }}/logs" - dir: "{{ seafile_root_dir }}/pids" - dir: "{{ seafile_data_dir }}" + mode: 770 - dir: "{{ seafile_data_dir }}/thumbnails" - dir: "{{ seafile_data_dir }}/seahub" - dir: "{{ seafile_data_dir }}/seahub/custom" - owner: "{{ seafile_user }}" - group: "{{ seafile_user }}" - dir: "{{ seafile_data_dir }}/seahub/cache" - owner: "{{ seafile_user }}" - group: "{{ seafile_user }}" - dir: "{{ seafile_data_dir }}/seahub/avatars" - owner: "{{ seafile_user }}" - group: "{{ seafile_user }}" - dir: "{{ seafile_data_dir }}/pro" - dir: "{{ seafile_root_dir }}/backup" mode: 700 diff --git a/roles/seafile/tasks/facts.yml b/roles/seafile/tasks/facts.yml index 9dc4dd7..40ab1fd 100644 --- a/roles/seafile/tasks/facts.yml +++ b/roles/seafile/tasks/facts.yml @@ -40,7 +40,7 @@ when: seafile_db_server == 'localhost' tags: seafile -- name: Generate a ID for seahub +- name: Generate an ID for seahub shell: date | sha1sum | awk '{ print $1 }' > {{ seafile_root_dir }}/meta/ansible_ccnet_id args: creates: "{{ seafile_root_dir }}/meta/ansible_ccnet_id" @@ -64,6 +64,7 @@ - import_tasks: ../includes/get_rand_pass.yml vars: - pass_file: "{{ seafile_root_dir }}/meta/ansible_dbpass" + - complex: False - set_fact: seafile_db_pass={{ rand_pass }} when: seafile_db_pass is not defined tags: seafile diff --git a/roles/seafile/tasks/install.yml b/roles/seafile/tasks/install.yml index 521be2c..53dac62 100644 --- a/roles/seafile/tasks/install.yml +++ b/roles/seafile/tasks/install.yml @@ -20,6 +20,7 @@ - java-1.8.0-openjdk # For seafile-pro - poppler-utils # For seafile-pro - unoconv # For seafile-pro + - python-setuptools # needed for ansible to create the venv tags: seafile - name: Check if py2 venv is setup @@ -128,6 +129,10 @@ dest: avatars tags: seafile +- name: Create data dir link + file: src={{ seafile_data_dir }} dest={{ seafile_root_dir }}/seafile-data state=link + tags: seafile + - name: Create pro-data link file: src={{ seafile_data_dir }}/pro dest={{ seafile_root_dir }}/pro-data state=link force=True when: seafile_license is defined @@ -142,6 +147,10 @@ when: seafile_install_mode == 'install' tags: seafile +- name: Copy default avatars + copy: src=avatars/ dest={{ seafile_data_dir }}/seahub/avatars/ + tags: seafile + # Needed since CentOS 7.5 so ldaps can be used - name: Remove bundled libs file: path={{ seafile_root_dir }}/seafile-server/seafile/lib/{{ item }} state=absent @@ -203,8 +212,8 @@ - name: Load database schema schema mysql_db: state: import - target: "{{ seafile_root_dir }}/seafile-server/seahub/sql/mysql.sql" - name: "{{ seafile_db_seahub }}" + target: "{{ item.file }}" + name: "{{ item.db }}" login_host: "{{ seafile_db_server }}" login_user: sqladmin login_password: "{{ mysql_admin_pass }}"