Ansible roles
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.0 KiB

---
- name: Create archive directory
file: path={{ seafile_root_dir }}/archives/{{ seafile_current_version.stdout }} state=directory
tags: seafile
- name: Stop the service during upgrade
service: name={{ item }} state=stopped
with_items:
- seafile
- seahub
tags: seafile
- name: Backup the databases
mysql_db:
state: dump
name: "{{ item }}"
target: "{{ seafile_root_dir }}/archives/{{ seafile_current_version.stdout }}/{{ item }}.sql"
login_host: "{{ seafile_db_server }}"
login_user: sqladmin
login_password: "{{ mysql_admin_pass }}"
quick: True
single_transaction: True
with_items:
- "{{ seafile_db_seafile }}"
- "{{ seafile_db_ccnet }}"
- "{{ seafile_db_seahub }}"
tags: seafile
- name: Archive seafile server
synchronize:
src: "{{ seafile_root_dir }}/seafile-server"
dest: "{{ seafile_root_dir }}/archives/{{ seafile_current_version.stdout }}/"
recursive: True
delete: True
delegate_to: "{{ inventory_hostname }}"
tags: seafile