Create backup for mysql databases on minisforum.
This commit is contained in:
@@ -30,10 +30,7 @@
|
||||
label: "{{ item.name }}"
|
||||
|
||||
- name: Create backup of mysql database and store to backup directory
|
||||
ansible.builtin.debug:
|
||||
msg:
|
||||
- '{{ item[1] }}' # Database configuration @see: when
|
||||
- '{{ item[0].name }}' # Container name
|
||||
shell: docker exec {{ item[1].container }} mysqldump -u{{ item[1].user }} -p{{ item[1].pass }} {{ item[1].name }} > {{ backup_location }}{{ item[0].name }}/{{ item[1].container }}-{{ ansible_date_time.iso8601_basic_short }}.sql
|
||||
when: item[1].type == "mysql"
|
||||
loop: "{{ containers | subelements('database', skip_missing=True) }}"
|
||||
loop_control:
|
||||
|
||||
Reference in New Issue
Block a user