Update to 2020-05-11 19:00

master
Daniel Berteaud 5 years ago
parent b1ca10dbba
commit 2d1b95e0dc
  1. 12
      roles/matrix_synapse/tasks/cleanup.yml
  2. 5
      roles/seafile/tasks/cleanup.yml
  3. 7
      roles/seafile/tasks/install.yml
  4. 7
      roles/seafile/templates/post-backup.sh.j2
  5. 16
      roles/seafile/templates/pre-backup.sh.j2
  6. 5
      roles/sudo/defaults/main.yml
  7. 8
      roles/zabbix_agent/tasks/iptables.yml
  8. 4
      roles/zabbix_agent/tasks/service.yml

@ -0,0 +1,12 @@
---
- name: Remove unused and tmp files
file: path={{ synapse_root_dir }}/{{ item }} state=absent
loop:
- lib
- lib64
- include
- bin
- db_dumps
tags: matrix

@ -10,4 +10,9 @@
- /etc/cron.d/seafil_gc - /etc/cron.d/seafil_gc
- "{{ seafile_data_dir }}/db_dumps" - "{{ seafile_data_dir }}/db_dumps"
- "{{ seafile_data_dir }}/backup" - "{{ seafile_data_dir }}/backup"
# All these are obsoletes backup hooks
- /etc/backup/pre.d/seafile_dump_db.sh
- /etc/backup/pre.d/seafile_mount_fuse.sh
- /etc/backup/post.d/seafile_rm_dumps.sh
- /etc/backup/post.d/seafile_umount_fuse.sh
tags: seafile tags: seafile

@ -234,4 +234,9 @@
when: seafile_systemd_unit.changed when: seafile_systemd_unit.changed
tags: seafile tags: seafile
- name: Deploy pre and post backup hooks
template: src={{ item }}-backup.sh.j2 dest=/etc/backup/{{ item }}.d/seafile.sh mode=700
loop:
- pre
- post
tags: seafile

@ -0,0 +1,7 @@
#!/bin/bash -e
# Delete database dumps
rm -f {{ seafile_root_dir }}/backup/*
# Umount fuse FS
{{ seafile_root_dir }}/seafile-server/seaf-fuse.sh stop

@ -0,0 +1,16 @@
#!/bin/bash -e
# Dump Databases
for DB in {{ seafile_db_ccnet }} {{ seafile_db_seafile }} {{ seafile_db_seahub }}; do
/usr/bin/mysqldump \
--quick --single-transaction \
{% if seafile_db_server not in ['127.0.0.1', 'localhost'] %}
--user='{{ seafile_db_user }}' \
--password='{{ seafile_db_pass }}' \
--host={{ seafile_db_server }} \
{% endif %}
--add-drop-table $DB | zstd -T0 -c > {{ seafile_root_dir }}/backup/$DB.sql.zst
done
# Mount fuse FS
{{ seafile_root_dir }}/seafile-server/seaf-fuse.sh start {{ seafile_root_dir }}/fuse/

@ -2,6 +2,9 @@
sudo_admin_groups: "{{ system_admin_groups | default(ad_auth | default(False) | ternary(['Domain\ Admins'],['admins'])) }}" sudo_admin_groups: "{{ system_admin_groups | default(ad_auth | default(False) | ternary(['Domain\ Admins'],['admins'])) }}"
sudo_defaults: {} sudo_base_defaults:
secure_path: /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
sudo_extra_defaults: {}
# sudo_defaults: # sudo_defaults:
# timestamp_timeout: 10 # timestamp_timeout: 10
sudo_defaults: "{{ sudo_base_defaults | combine(sudo_extra_defaults, recursive=True) }}"

@ -0,0 +1,8 @@
---
- name: Handle Zabbix Agent port
iptables_raw:
name: zabbix_agent_port
state: "{{ (zabbix_agent_src_ip | length > 0) | ternary('present', 'absent') }}"
rules: "-A INPUT -m state --state NEW -p tcp --dport {{ zabbix_agent_port }} -s {{ zabbix_agent_src_ip | join(',') }} -j ACCEPT"
when: iptables_manage | default(True)
tags: zabbix

@ -0,0 +1,4 @@
---
- name: Start Zabbix Agent
service: name=zabbix-agent state=started enabled=True
tags: zabbix
Loading…
Cancel
Save