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

Conversation

alsmk
Copy link
Collaborator

@alsmk alsmk commented Jan 13, 2025

No description provided.

Copy link

Oops! Looks like you forgot to update the changelog. When updating CHANGELOG.md, please consider the following:

  • Changelog is read by country implementors who might not always be familiar with all technical details of OpenCRVS. Keep language high-level, user friendly and avoid technical references to internals.
  • Answer "What's new?", "Why was the change made?" and "Why should I care?" for each change.
  • If it's a breaking change, include a migration guide answering "What do I need to do to upgrade?".

@alsmk alsmk requested a review from rikukissa January 13, 2025 14:42
@alsmk alsmk self-assigned this Jan 13, 2025
@alsmk
Copy link
Collaborator Author

alsmk commented Jan 13, 2025

i didn't finalize my changes
This is just a draft for having an idea from reviews
if the changes stands I will do write ansible task for When setting up a periodic restore from the backup server, let's download a file from the backup server to verify the connection works as the same way

@alsmk alsmk changed the title set up 2 more crons Testing backup server works or not Jan 13, 2025
@alsmk alsmk requested a review from n1koo January 17, 2025 08:47
- 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

- 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'
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

- 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

@alsmk alsmk closed this Jan 21, 2025
@alsmk alsmk deleted the check-backup-connectivity branch January 21, 2025 11:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add verification of backup connections in ansible playbooks
2 participants