DEV-1058 bugfix backup process

- fixed hard coded ... things
qa
Sven Ketelsen 3 years ago
parent 69e37093b9
commit 0cd70dcded

@ -57,7 +57,7 @@
tasks: tasks:
- name: "Add {{ database_engine }} servers to hosts if necessary" - name: "Add {{ database_engine }} servers to hosts if necessary"
add_host: add_host:
name: "{{shared_service_postgres_secondary }}" name: "{{ shared_service_postgres_secondary }}"
groups: groups:
- "stage_{{ stage }}" - "stage_{{ stage }}"
- '{{ database_engine }}' - '{{ database_engine }}'
@ -116,7 +116,7 @@
become_user: '{{ storageserver_system_user }}' become_user: '{{ storageserver_system_user }}'
vars: vars:
# should work with non-fqdn due to existing entry in /etc/hosts # should work with non-fqdn due to existing entry in /etc/hosts
database_server_ip: "{{ stage }}-{{ database_engine }}-{{'02' if database_engine == 'postgres' else '01'}}" database_server_ip: "{{ shared_service_postgres_secondary if database_engine == 'postgres' else shared_service_maria_primary }}"
shell: '/home/{{ storageserver_system_user }}/pull_remote_backups.sh {{ database_server_ip }} {{ stage }} {{ database_engine }}' shell: '/home/{{ storageserver_system_user }}/pull_remote_backups.sh {{ database_server_ip }} {{ stage }} {{ database_engine }}'
when: when:
- inventory_hostname in groups['storage'] - inventory_hostname in groups['storage']

@ -48,7 +48,7 @@
shell: | shell: |
set -o pipefail set -o pipefail
/usr/bin/mariabackup --defaults-file={{ my_cnf_file }} --backup --stream=xbstream | gzip > {{ backup_file }} && \ /usr/bin/mariabackup --defaults-file={{ my_cnf_file }} --backup --stream=xbstream | gzip > {{ backup_file }} && \
gpg --encrypt --recipient "smardigo automation DEV" --trust-model always {{ backup_file }} && \ gpg --encrypt --recipient "{{ backup_gpg_recipient }}" --trust-model always {{ backup_file }} && \
rm {{ backup_file }} rm {{ backup_file }}
args: args:
executable: /bin/bash executable: /bin/bash

Loading…
Cancel
Save