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.
28 lines
703 B
28 lines
703 B
![]()
4 years ago
|
---
|
||
|
|
||
|
- name: Create archive dir
|
||
|
file: path={{ root_dir }}/archives/{{ version }} state=directory mode=700
|
||
|
|
||
|
- name: Archive previous version
|
||
|
synchronize:
|
||
|
src: "{{ root_dir }}/web"
|
||
|
dest: "{{ root_dir }}/archives/{{ version }}/"
|
||
|
recursive: True
|
||
|
delete: True
|
||
|
delegate_to: "{{ inventory_hostname }}"
|
||
|
|
||
|
- name: Dump the database
|
||
|
mysql_db:
|
||
|
state: dump
|
||
|
name: "{{ db_name }}"
|
||
|
target: "{{ root_dir }}/archives/{{ version }}/{{ db_name }}.sql.xz"
|
||
|
login_host: "{{ db_server | default(mysql_server) }}"
|
||
|
login_user: sqladmin
|
||
|
login_password: "{{ mysql_admin_pass }}"
|
||
|
quick: True
|
||
|
single_transaction: True
|
||
|
environment:
|
||
|
XZ_OPT: -T0
|
||
|
when: db_name is defined
|
||
|
|