From ce899d4010992419e34f9cfa1fc70eb41415e6a5 Mon Sep 17 00:00:00 2001 From: Christian Steinle Date: Wed, 17 Nov 2021 11:15:37 +0100 Subject: [PATCH] Add extra step for compression and cleanup debug output. --- host.yaml | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/host.yaml b/host.yaml index 0b01bb7..6f962c0 100644 --- a/host.yaml +++ b/host.yaml @@ -8,27 +8,15 @@ tasks: - include_vars: vars/secret.yaml - - debug: var=ansible_date_time.iso8601_basic_short - - name: Backup mysql databases - shell: docker exec mysql8 mysqldump -u{{ mysql_user }} -p{{ mysql_password }} {{ item }} > /home/chris/{{ item }}_{{ ansible_date_time.iso8601_basic_short }}.sql |gzip + shell: docker exec mysql8 mysqldump -u{{ mysql_user }} -p{{ mysql_password }} {{ item }} > /home/chris/{{ item }}_{{ ansible_date_time.iso8601_basic_short }}.sql loop: - bookstack - kimai - - name: Check uname - shell: uname -a - register: command_output - - - debug: var=command_output.stdout_lines - - - name: Check docker containers - shell: docker ps - register: containers - - - debug: var=containers.stdout_lines - - - debug: var=mysql_user - - - debug: var=mysql_password - \ No newline at end of file + - name: Compress mysql backup files + shell: gzip /home/chris/{{ item }}_{{ ansible_date_time.iso8601_basic_short }}.sql + loop: + - bookstack + - kimai +