From 4e6a545b2bc2937a601f8d5c652ba137f3c3ef1a Mon Sep 17 00:00:00 2001 From: chris Date: Sun, 21 Nov 2021 22:17:54 +0100 Subject: [PATCH] Check database variable. --- hetzner.yaml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/hetzner.yaml b/hetzner.yaml index 03a59bb..e8711aa 100644 --- a/hetzner.yaml +++ b/hetzner.yaml @@ -13,10 +13,17 @@ path: "{{ backup_dir }}" state: directory - - name: Check if customer directories exist + - name: Create customer directories file: path: "{{ backup_dir }}/{{ item.key }}" state: directory loop: "{{ lookup('dict', customers) }}" loop_control: label: "{{ item.key }}" + + - name: Backup databases + debug: var=item + loop: "{{ customers | map(attribute='databases') | list }} + +# - name: Backup databases +# shell: mysqldump -u{{ mysql_user }} -p{{ mysql_password }} {{ item }} > {{ backup_dir }}/{{ item }}/db-{{ ansible_date_time.iso8601_basic_short }}.sql \ No newline at end of file