diff --git a/hetzner.yaml b/hetzner.yaml index 6cb37f4..cf09a24 100644 --- a/hetzner.yaml +++ b/hetzner.yaml @@ -21,27 +21,33 @@ loop_control: label: "{{ item.key }}" - - - name: Backup databases - shell: mysqldump -u{{ mysql_user }} -p{{ mysql_password }} {{ item.value.database }} > {{ backup_dir }}/{{ item.key }}/db-{{ ansible_date_time.iso8601_basic_short }}.sql + - name: Create storage backups + debug: var=item.key + when: item.value.storage is defined loop: "{{ lookup('dict', customers) }}" loop_control: label: "{{ item.key }}" - - name: Compress database backups - shell: gzip {{ backup_dir }}/{{ item.key }}/db-{{ ansible_date_time.iso8601_basic_short }}.sql - loop: "{{ lookup('dict', customers) }}" - loop_control: - label: "{{ item.key }}" - - - name: Fetch backups - fetch: - src: "{{ backup_dir }}/{{ item.key }}/db-{{ ansible_date_time.iso8601_basic_short }}.sql.gz" - dest: "{{ local_backup }}/{{ item.key }}/" - flat: yes - loop: "{{ lookup('dict', customers) }}" - loop_control: - label: "{{ item.key }}" +# - name: Backup databases +# shell: mysqldump -u{{ mysql_user }} -p{{ mysql_password }} {{ item.value.database }} > {{ backup_dir }}/{{ item.key }}/db-{{ ansible_date_time.iso8601_basic_short }}.sql +# loop: "{{ lookup('dict', customers) }}" +# loop_control: +# label: "{{ item.key }}" +# +# - name: Compress database backups +# shell: gzip {{ backup_dir }}/{{ item.key }}/db-{{ ansible_date_time.iso8601_basic_short }}.sql +# loop: "{{ lookup('dict', customers) }}" +# loop_control: +# label: "{{ item.key }}" +# +# - name: Fetch database backups +# fetch: +# src: "{{ backup_dir }}/{{ item.key }}/db-{{ ansible_date_time.iso8601_basic_short }}.sql.gz" +# dest: "{{ local_backup }}/{{ item.key }}/" +# flat: yes +# loop: "{{ lookup('dict', customers) }}" +# loop_control: +# label: "{{ item.key }}" - name: Clean backup directory file: diff --git a/vars/hetzner/variable.yaml b/vars/hetzner/variable.yaml index ee01039..693bb56 100644 --- a/vars/hetzner/variable.yaml +++ b/vars/hetzner/variable.yaml @@ -12,6 +12,7 @@ customers: database: c2_buehler svj: database: c4_svj + storage: /var/www/clients/client4/web4/web/media/svjf maier: database: c5_maier ispconfig: