-
Notifications
You must be signed in to change notification settings - Fork 17
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -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 | ||||
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' | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Unused variable definition |
||||
when: "'backups' in groups and groups['backups'] | length > 0 and backup_restore_encryption_passphrase and periodic_restore_from_backup" | ||||
tags: | ||||
- backups | ||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused variable definition