added more configuration, but tests failed.
This commit is contained in:
12
TODO.md
12
TODO.md
@@ -1,10 +1,10 @@
|
||||
## todo
|
||||
|
||||
- [ ] install smbclient php module
|
||||
- [ ] install ownCloud via task (trusted domains can
|
||||
- [x] install smbclient php module
|
||||
- [x] install ownCloud via task (trusted domains can
|
||||
be added afterwards)
|
||||
- [ ] configure cron jobs
|
||||
- [ ] configure caching and file locking
|
||||
- [ ] configure log rotation
|
||||
- [ ] add redis to stack and configure it
|
||||
- [x] configure cron jobs
|
||||
- [x] configure caching and file locking
|
||||
- [x] add redis to stack and configure it
|
||||
- [x] configure log rotation
|
||||
- [ ] configure https access in apache2
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
domain_base: reliyya.xyz
|
||||
domain_base: softbox.net
|
||||
hostname: owncloud.{{ domain_base }}
|
||||
|
||||
owncloud_core_path: "/var/www/owncloud"
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
#10.0.101.15 ansible_user=root ansible_port=22
|
||||
#
|
||||
[owncloud]
|
||||
10.56.0.99 ansible_user=reliyya ansible_port=22
|
||||
10.0.101.99 ansible_user=sbxadmin ansible_port=22
|
||||
|
||||
|
||||
13
roles/owncloud/tasks/configure.yml
Normal file
13
roles/owncloud/tasks/configure.yml
Normal file
@@ -0,0 +1,13 @@
|
||||
- name: Configure Caching and File locking
|
||||
command: "{{ item }}"
|
||||
loop: >
|
||||
- occ config:system:set memcache.local --value '\OC\Memcache\APCu'
|
||||
- occ config:system:set memcache.locking --value '\OC\Memcache\Redis'
|
||||
- occ config:system:set redis --value '{"host": "127.0.0.1", "port": "6379"}' --type json
|
||||
|
||||
- name: Configure Log Rotation.
|
||||
template:
|
||||
src: "templates/log-rotation.j2"
|
||||
dest: "/etc/logrotate.d/owncloud"
|
||||
owner: root
|
||||
group: root
|
||||
19
roles/owncloud/tasks/cron.yml
Normal file
19
roles/owncloud/tasks/cron.yml
Normal file
@@ -0,0 +1,19 @@
|
||||
- name: Set background job mode to cron.
|
||||
commmand: occ background:cron
|
||||
|
||||
- name: Set the exectution of cron jobs to every 15 min.
|
||||
ansible.builtin.cron:
|
||||
name: "exe cron."
|
||||
minute: "*/15"
|
||||
user: www-data
|
||||
job: "/var/www/owncloud/occ system:cron"
|
||||
state: present
|
||||
|
||||
- name: Cleanup of chunks every night at 2am.
|
||||
ansible.builtin.cron:
|
||||
name: "cleanup chunks."
|
||||
minute: "0"
|
||||
hour: "2"
|
||||
user: www-data
|
||||
job: "/var/www/owncloud/occ dav:cleanup-chunks"
|
||||
state: present
|
||||
@@ -22,3 +22,11 @@
|
||||
- name: Download ownCloud.
|
||||
include_tasks:
|
||||
file: owncloud.yml
|
||||
|
||||
- name: Configure Cronjobs.
|
||||
include_tasks:
|
||||
file: cron.yml
|
||||
|
||||
- name: Configure ownCloud.
|
||||
include_tasks:
|
||||
file: configure.yml
|
||||
|
||||
@@ -11,9 +11,14 @@
|
||||
dest: "/var/www/"
|
||||
owner: www-data
|
||||
remote_src: yes
|
||||
#- name: Configure ownCloud's trusted domains
|
||||
# command: "{{ item }}"
|
||||
# loop:
|
||||
# - my_ip=$(hostname -I|cut -f1 -d ' ')
|
||||
# - occ config:system:set trusted_domains 1 --value="$my_ip"
|
||||
# - occ config:system:set trusted_domains 2 --value="{{ hostname }}"
|
||||
|
||||
- name: Install ownCloud (via occ)
|
||||
command: >
|
||||
occ maintenance:install --database "mysql" --database-name "owncloud" --database-user "owncloud" --database-pass "{{ mysql_passwd }}" --data-dir "{{ owncloud_core_path }}/data" --admin-user "root" --admin-pass "{{ mysql_passwd }}"
|
||||
|
||||
- name: Configure ownCloud's trusted domains
|
||||
command: "{{ item }}"
|
||||
loop:
|
||||
- my_ip=$(hostname -I|cut -f1 -d ' ')
|
||||
- occ config:system:set trusted_domains 1 --value="$my_ip"
|
||||
- occ config:system:set trusted_domains 2 --value="{{ hostname }}"
|
||||
|
||||
@@ -6,3 +6,11 @@
|
||||
line: "opcache.memory_consumption = 96"
|
||||
state: present
|
||||
notify: restart apache
|
||||
|
||||
- name: Adjust smbclient setting.
|
||||
template:
|
||||
src: "templates/smbclient.ini.j2"
|
||||
dest: "/etc/php/7.4/mods-available/smbclient.ini"
|
||||
owner: root
|
||||
group: root
|
||||
notify: restart apache
|
||||
|
||||
8
roles/owncloud/templates/log-rotation.j2
Normal file
8
roles/owncloud/templates/log-rotation.j2
Normal file
@@ -0,0 +1,8 @@
|
||||
/var/www/owncloud/data/owncloud.log {
|
||||
size 10M
|
||||
rotate 12
|
||||
copytruncate
|
||||
missingok
|
||||
compress
|
||||
compresscmd /bin/gzip
|
||||
}
|
||||
1
roles/owncloud/templates/smbclient.ini.j2
Normal file
1
roles/owncloud/templates/smbclient.ini.j2
Normal file
@@ -0,0 +1 @@
|
||||
extension=smbclient.so
|
||||
Reference in New Issue
Block a user