Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing backup server works or not #1202

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions infrastructure/server-setup/backups.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,3 +174,25 @@
when: "'backups' in groups and groups['backups'] | length > 0 and ssh_test.rc != 0"
tags:
- backups

- name: Create a file to transfer to the backup server
shell: touch /tmp/test_file.txt
tags:
- backups

- name: Check ability to transfer a file to the backup server
shell: rsync -avz -e "ssh -o StrictHostKeyChecking=no -o ConnectTimeout=5" /tmp/test_file.txt {{ backup_server_user }}@{{ destination_server }}:{{ backup_server_remote_target_directory }}/test_file.txt
remote_user: '{{ crontab_user }}'
register: rsync_test
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
register: rsync_test

Unused variable definition

when: "'backups' in groups and groups['backups'] | length > 0"
tags:
- backups

- name: Check if file can be transferred to the staging server from backup server
shell: ssh -o StrictHostKeyChecking=no -o ConnectTimeout=5 {{ backup_server_user }}@{{ destination_server }} 'rsync -avz -e "ssh -o StrictHostKeyChecking=no -o ConnectTimeout=5" {{ backup_server_remote_target_directory }}/test_file.txt {{ crontab_user }}@{{ inventory_hostname }}:/tmp/test_file.txt'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't look correct. Instead of backup machine sending the file to the staging server, the staging server should be downloading it using rsync. This ansible step also needs to be restricted to be ran only for staging servers

remote_user: '{{ crontab_user }}'
register: rsync_test_from_backup
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
register: rsync_test_from_backup

Unused variable definition

when: "'backups' in groups and groups['backups'] | length > 0 and backup_restore_encryption_passphrase and periodic_restore_from_backup"
tags:
- backups

Loading