-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplay_20_seafile.yml
220 lines (183 loc) · 6.68 KB
/
play_20_seafile.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
# Dieses Playbook installiert Seafile auf den Zielservern.
# TODO Rolle funktioniert nicht! Seafile muss manuell installiert werden!
# TODO Voraussetzungen: apt-get install python
# TODO Voraussetzungen: apt-get install python2.7 libpython2.7 python-setuptools python-ldap python-urllib3 ffmpeg python-pip python-mysqldb python-memcache python-requests
# TODO Voraussetzungen: pip install Pillow==4.3.0
# TODO Voraussetzungen: apt-get install nfs-common
# TODO Voraussetzungen: directory zum mounten kreieren, z.B. /opt/netcup_storageserver/
# TODO Voraussetzungen: den mount durchführen: mount 46.38.248.210:/voln44901a1 /opt/netcup_storageserver
# symlink im /opt/seafile kreieren: ln -s /opt/netcup_storageserver/seafile/seafile-data/ seafile-data
---
- name: Seafile installieren
hosts:
- ehtest
vars_files:
- vars
- vault
vars:
seafile_install_version: '6.3.2'
seafile_user: seafile
seafile_user_home: /home/seafile
seafile_org_name: 'Seafile'
seafile_server_name: '{{ seafile_org_name }}'
seafile_ip_or_domain: 'seafile.{{ domain }}'
seafile_service_url: https://{{ seafile_ip_or_domain }}
seafile_quota_enable: false
seafile_quota_default: 2
seafile_history_keepall: true # set to false to enable keep_days limit
seafile_history_keep_days: 30
seafile_max_upload_size_enable: false # set to true to enable max
seafile_max_upload_size: 200 # MB
seafile_max_download_dir_size_enable: false # set to true to enable max
seafile_max_download_dir_size: 200 # MB
seafile_email_enable: enable
seafile_email_use_tls: true
seafile_email_host: "{{ host_ssmtp_host }}"
seafile_email_port: "{{ host_ssmtp_port }}"
seafile_email_user: "{{ host_ssmtp_AuthUser }}"
seafile_email_password: "{{ host_ssmtp_AuthPass }}"
seafile_default_from_email: "Seafile auf {{ seafile_email_user }}"
seafile_server_email: "{{ seafile_email_user }}"
seafile_time_zone: 'Europe/Brussels'
seafile_site_base: 'https://{{ seafile_ip_or_domain }}/'
seafile_site_name: '{{ seafile_org_name }}' # used in email notifications
seafile_site_title: '{{ seafile_org_name }}'
seafile_site_root: '/'
seafile_cloud_mode: true
#seafile_logo_path: 'custom/ginsys_seafile_logo.png'
# network ports
seafile_ccnet_port: 10001
seafile_seafile_port: 12001
seafile_httpserver_port: 8082
seafile_webdav_port: 8080
seafile_fastcgi_enabled: false
seafile_webdav_enabled: true
seafile_webdav_fastcgi: true
seafile_webdav_path: /dav
seafile_seahub_admin_email: _vault_seafile__seahub_admin_email
seafile_seahub_admin_password: _vault_seafile__seahub_admin_password
# database settings
seafile_backend: mysql
#mysql configuration
#
mysql_root_db_pass: " {{ _vault_mysql_root_password }}"
seafile_db_user: 'seafile'
seafile_db_pass: "{{ _vault_mysql_seafile_password }}"
seafile_db_host: '127.0.0.1'
seafile_db_port: '3306'
seafile_db_name:
ccnet: 'ccnet'
seafile: 'seafile'
seahub: 'seahub'
mysql_root_username: root
mysql_root_password: "{{ _vault_mysql_root_password }}"
mysql_root_password_update: true
mysql_enabled_on_startup: true
mysql_bind_address: '{{ seafile_db_host }}'
mysql_db:
- name: '{{ seafile_db_name.ccnet }}'
replicate: no
encoding: utf8
- name: '{{ seafile_db_name.seafile }}'
replicate: no
encoding: utf8
- name: '{{ seafile_db_name.seahub }}'
replicate: no
encoding: utf8
mysql_users:
- name: '{{ seafile_db_user }}'
password: '{{ seafile_db_pass }}'
priv: >
{{ seafile_db_name.ccnet ~ ".*:ALL/" ~
seafile_db_name.seafile ~ ".*:ALL/" ~
seafile_db_name.seahub ~ ".*:ALL" }}
## cron jobs
# a weekly job to perform garbage collection
seafile_cron_gc_enabled: true
## ldap
#seafile_ldap:
# host: 'ldap://127.0.0.1'
# base: 'ou=people,dc=example,dc=com'
# user_dn: 'cn=seafile,ou=services,dc=example,dc=com'
# password: 'cleartext-password'
# login_attr: mail
## cron jobs
# a weekly job to perform garbage collection
seafile_cron_gc_enabled: true
## ldap
#seafile_ldap:
# host: 'ldap://127.0.0.1'
# base: 'ou=people,dc=example,dc=com'
# user_dn: 'cn=seafile,ou=services,dc=example,dc=com'
# password: 'cleartext-password'
# login_attr: mail
# noch einstellen: Seafile starten
# mount 46.38.248.210:/voln44901a1 /opt/netcup_storageserver
# su seafile
# /opt/seafile/seafile-s-latest/seafile.sh start seahub.sh start
# on the new machine, make sure mysql_server is installed and setup a new user:
# CREATE USER 'seafile@localhost' IDENTIFIED BY password
# SELECT User, Host, authentication_string FROM mysql.user;
pre_tasks:
- apt:
name: "{{ item }}"
update_cache: no
state: present
loop:
- python3-pip
- python-pip
- pip:
name: pymysql
state: latest
roles:
- ansible-role-mysql
- ansible-role-seafile
post_tasks:
- name: allow web server access to seafile data
user:
name: 'www-data'
groups: '{{ seafile_user }}'
append: yes
# TODO: alte /opt/seafile/ccnet.conf verarbeiten:
#[General]
#USER_NAME = eHanse
#ID = d57adabbd9ac869316f312b11caba1a6202308f9
#NAME = eHanse
#SERVICE_URL = https://seafile.ehanse.de
#
#[Network]
#PORT = 10001
#
#[Client]
#PORT = 13418
# INFO : alte mysql Rolle:
# Dieses Playbook installiert Seafile auf den Zielservern.
#
#---
#- name: MySQL installieren mit der Rolle von geerlingguy
# hosts:
# - ehtest
# become: yes
# vars_files:
# - vars
# - vault
# vars:
# mysql_root_home: /root
# mysql_root_username: root
# mysql_root_password: "{{ _vault_mysql_root_password }}"
# #mysql_root_password_update: true
# mysql_enabled_on_startup: true
#
# mysql_databases:
# - name: example_db
# encoding: latin1
# collation: latin1_general_ci
# mysql_users:
# - name: example_user
# host: "%"
# password: similarly-secure-password
# priv: "example_db.*:ALL"
#
#
# roles:
# - ansible-role-mysql